Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgcaw-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgcaw-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pgcaw-1.0.0.tar.gz.

File metadata

  • Download URL: pgcaw-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 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

Hashes for pgcaw-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bce533f68be4e49bf4c6869c3807c11411503f6b7d09912a6f574cb70ecbdf90
MD5 dbde26370a175e71e4c5339b0fe77a17
BLAKE2b-256 b8a964171760e9785d93797cb78b11c814d8d9c43634b1f4d1f3eda7548354d9

See more details on using hashes here.

File details

Details for the file pgcaw-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pgcaw-1.0.0-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

Hashes for pgcaw-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da18a60107d2c1c64dca33e4ae92596f3727f6bfa27486872d814981d7ac7ae3
MD5 e73ebfbb627c58ecf9e9d6372541dfac
BLAKE2b-256 b10b941f525e08dce019534fbab391c2d7762ba383117f89b490aa6f97b3bcf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page