Welcome to github_contributions’ documentation!

Contents:

github_contributions

github_contributions.GithubUser

class github_contributions.user.GithubUser(username, url=None)

Represents a user on github, and can poll information about that user’s contribution history.

Parameters:
  • username (str) – The user’s Github username
  • url (str) – The base Github URL – useful for use on Github Enterprise. (Optional)
contributions(start_date=None, end_date=None)

Fetches the contribution history for the given user

By default, fetches 1 year of contribution history

Parameters:
  • start_date (date) – Optional start date
  • end_date (date) – Optional end date. Defaults to today.
Returns:

Returns contributions object

Return type:

GithubContributions

current_streak()

Returns the active streak of the user

Will return the full list of days associated with the user’s streak even if this streak lasts longer than 1 year.

Returns:Returns list of days representing current streak
Return type:list[Day]
longest_streak()

Fetches the longest contribution streak of the user

Only checks for streaks that have started within the past year.

Returns:Returns list of days representing longest known streak
Return type:list[Day]

github_contributions.GithubContributions

class github_contributions.contributions.GithubContributions(soup=None, days=None)

Represents a set of contributions performed by a GithubUser

streaks()

Produces a list of streaks within the days known by the contributions object

Returns:the list of streaks
Return type:list[list[Day]]
today()

Returns the contribution day object for the current date.

Returns:the current day.
Return type:Day
class github_contributions.contributions.Day

Data container object for contribution data of a given day.

date

Date associated with the day

count

Number of contributions done by the user on this day

level

“Contribution level” of the day.

Corresponds to the color displayed in the contribution graph. Has a value between 0 and 4 (inclusive)