aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services/git_data/blobs.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygithub3/services/git_data/blobs.py')
-rw-r--r--pygithub3/services/git_data/blobs.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/pygithub3/services/git_data/blobs.py b/pygithub3/services/git_data/blobs.py
new file mode 100644
index 0000000..d5baa2d
--- /dev/null
+++ b/pygithub3/services/git_data/blobs.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+
+from pygithub3.services.base import Service
+
+
+class Blobs(Service):
+ """Consume `Blobs API <http://developer.github.com/v3/git/blobs/>`_"""
+
+ def get(self, sha, user=None, repo=None):
+ """Get a particular blob
+
+ :param str sha: The sha of the blob to get
+
+ """
+ request = self.make_request('git_data.blobs.get', sha=sha,
+ user=user, repo=repo)
+ return self._get(request)
+
+ def create(self, data, user=None, repo=None):
+ """Create a blob"""
+ request = self.make_request('git_data.blobs.create', body=data,
+ user=user, repo=repo)
+ return self._post(request)