PGCAW is a very simple API wrapper for the github contributions calendar.
Project description
PGCAW: The Python Github Calendar API Wrapper
PGCAW is a very simple API wrapper for the github contributions calendar. The wrapper supports extracting data about any given users contribution history, such as total contributions in the last year and daily contribution numbers.
Installation
The recommended way to install PGCAW is using pip.
pip install pgcaw
Usage
To gather data about a specific Github user you first need to create a Contributions instance, initialized with the given users username.
>>> import pgcaw
>>> contributions = pgcaw.Contributions("CGodiksen")
Using this instance you can now get data related to the users Github calendar.
>>> contributions.total()
1758
>>> contributions.daily()
[(datetime.date(2020, 12, 20), 1), (datetime.date(2020, 12, 21), 1), (datetime.date(2020, 12, 22), 16)]
Notice that daily() returns a list of tuples with the format [(date, number_contributions_on_date)].
The class also contains some utility methods used to extract further information from the contributions graph.
>>> daily = contributions.daily()
>>> contributions.current_streak(daily)
(23, datetime.date(2020, 1, 12), datetime.date(2020, 12, 23))
>>> contributions.longest_streak(daily)
(105, datetime.date(2020, 8, 10), datetime.date(2020, 11, 23))
Note here that both current_streak() and longest_streak() returns a tuple with the format (streak_length, from_date, to_date).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgcaw-1.0.1.tar.gz.
File metadata
- Download URL: pgcaw-1.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f29df695d951a85e4238f52cc13f0d85e6841f49d8530c1bed9d7879eb93c62
|
|
| MD5 |
7a85b1abd01a6bb7cb96bd9cf770bdbf
|
|
| BLAKE2b-256 |
89808299f2cbf5f0d2614be17a65bbf88c940df8b45e92676bf87b841e8364f8
|
File details
Details for the file pgcaw-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pgcaw-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ba1024b0b3d42ecf43a2ae3cc7bbeb701ddd8831f23fe74c249296d4e7e2e5
|
|
| MD5 |
60d3613c51704b24cb4142ef493c5fb5
|
|
| BLAKE2b-256 |
d733b187549f216d9586c62fccec7a226ac9d7202139409f31baf0f291754707
|