New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pgcaw

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pgcaw

PGCAW is a very simple API wrapper for the github contributions calendar.

  • 1.0.1
  • PyPI
  • Socket score

Maintainers
1

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).

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc