gharchive package¶
Python SDK to access Github Archive
Submodules¶
gharchive.exc module¶
gharchive.logger module¶
gharchive.main module¶
-
class
gharchive.main.GHArchive[source]¶ Bases:
objectMain class for getting Github Archive data.
- Examples
>>> from gharchive import GHArchive >>> gh = GHArchive() ... >>> data = gh.get('6/8/2020', '6/10/2020', filters=[ >>> ('repo.name', 'bitcoin/bitcoin'), >>> ('type', 'WatchEvent') >>> ])
-
get(start_date, end_date=None, filters=None)[source]¶ Get data from the Github Archive
- Parameters
the same as start date :type _sphinx_paramlinks_gharchive.main.GHArchive.get.filters:
Optional[Sequence[Tuple[str,Union[int,float,str]]]] :param _sphinx_paramlinks_gharchive.main.GHArchive.get.filters: filters in the format of two-element tuples for which the first element is the . separated path to look up a value from the Archive object and the second is a value which it should be equal to :rtype:Archive:return: Archive object containing Github Archive data- Examples
>>> from gharchive import GHArchive >>> gh = GHArchive() ... >>> data = gh.get('6/8/2020', '6/10/2020', filters=[ >>> ('repo.name', 'bitcoin/bitcoin'), >>> ('type', 'WatchEvent') >>> ])
gharchive.models module¶
-
class
gharchive.models.Actor(id, login, display_login, gravatar_id, url, avatar_url)[source]¶
-
class
gharchive.models.ArchiveElement(id, type, actor, repo, payload, public, created_at)[source]¶ Bases:
gharchive.models.SeriesSerializable-
__init__(id, type, actor, repo, payload, public, created_at)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
actor: Optional[Actor]¶
-
created_at: Optional[datetime]¶
-
payload: Optional[Payload]¶
-
repo: Optional[Repo]¶
-
-
class
gharchive.models.Commit(sha, author, message, distinct, url)[source]¶ Bases:
gharchive.models.SeriesSerializable-
__init__(sha, author, message, distinct, url)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
gharchive.models.Payload(ref, ref_type, pusher_type, push_id, size, distinct_size, head, before, commits)[source]¶ Bases:
gharchive.models.SeriesSerializable-
__init__(ref, ref_type, pusher_type, push_id, size, distinct_size, head, before, commits)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
commits: Optional[List[Commit]]¶
-