| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-03-22 | 7.6 kB | |
| v2.9.0 source code.tar.gz | 2026-03-22 | 2.6 MB | |
| v2.9.0 source code.zip | 2026-03-22 | 4.0 MB | |
| Totals: 3 Items | 6.6 MB | 0 | |
Notable changes
Lazy PyGithub objects
The notion of lazy objects has been added to some PyGithub classes in version 2.6.0. This release now makes all CompletableGithubObjects optionally lazy (if useful). See https://github.com/PyGithub/PyGithub/pull/3403 for a complete list.
In lazy mode, getting a PyGithub object does not send a request to the GitHub API. Only accessing methods and properties sends the necessary requests to the GitHub API:
:::python
# Use lazy mode
g = Github(auth=auth, lazy=True)
# these method calls do not send requests to the GitHub API
user = g.get_user("PyGithub") # get the user
repo = user.get_repo("PyGithub") # get the user's repo
pull = repo.get_pull(3403) # get a known pull request
issue = pull.as_issue() # turn the pull request into an issue
# these method and property calls send requests to Github API
issue.create_reaction("rocket") # create a reaction
created = repo.created_at # get property of lazy object repo
# once a lazy object has been fetched, all properties are available (no more requests)
licence = repo.license
All PyGithub classes that implement CompletableGithubObject support lazy mode (if useful). This is only useful for classes that have methods creating, changing, or getting objects.
By default, PyGithub objects are not lazy.
PyGithub objects with a paginated property
The GitHub API has the "feature" of paginated properties. Some objects returned by the API have a property that allows for pagination. Fetching subsequent pages of that property means fetching the entire object (with all other properties) and the specified page of the paginated property. Iterating over the paginated property means fetching all other properties multiple times. Fortunately, the allowed size of each page (per_page is usually 300, in contrast to the "usual" per_page maximum of 100).
Objects with paginated properties:
- Commit.files
- Comparison.commits
- EnterpriseConsumedLicenses.users
This PR makes iterating those paginated properties use the configured per_page setting.
It further allows to specify an individual per_page when either retrieving such objects, or fetching paginated properties.
See Classes with paginated properties for details.
Drop Python 3.8 support due to End-of-Life
Python 3.8 reached its end-of-life September 6, 2024. Support has been removed with this release.
Deprecations
- Method
deleteofReactionis deprecated, useIssueComment.delete_reaction,PullRequestComment.delete_reaction,CommitComment.delete_reactionorIssue.delete_reactioninstead. - Method
Issue.assigneeand parameterIssue.edit(assignee=…)are deprecated, useIssue.assigneesandIssue.edit(assignees=…)instead. -
Method
Organization.edit_hookis deprecated, useOrganization.get_hook(id).edit(…)instead. If you need to avoidOrganization.get_hook(id)to fetch theHookobject from Github API, use a lazy Github instance::::python Github(…, lazy=True).get_organization(…).get_hook(id).edit(…)
-
Methods
Team.add_to_membersandTeam.remove_from_membersare deprecated, useTeam.add_membershiporTeam.remove_membershipinstead.
New Features
- Consider per-page settings when iterating paginated properties by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3377
- Add Secret Scanning Alerts and Improve Code Scan Alerts by @matt-davis27 in https://github.com/PyGithub/PyGithub/pull/3307
Improvements
- More lazy objects by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3403
- Allow for enterprise base url prefixed with
api.by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3419 - Add
throwoption toWorkflow.create_dispatchto raise exceptions by @dblanchette in https://github.com/PyGithub/PyGithub/pull/2966 - Use
GETurl or_links.selfas object url by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3421 - Add support for
typeparameter to get_issues by @nrysk in https://github.com/PyGithub/PyGithub/pull/3381 - Align implemented paths with OpenAPI spec by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3413
- Add suggested OpenAPI schemas by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3411
- Apply OpenAPI schemas by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3412
Bug Fixes
- Fix
PaginatedList.totalCountreturning 0 with GitHub deprecation notices by @odedperezcodes in https://github.com/PyGithub/PyGithub/pull/3382 - Use default type if known type is not supported by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3365
Maintenance
- Deprecate
Reaction.deleteby @iarspider in https://github.com/PyGithub/PyGithub/pull/3435 - Deprecate
Issue.assigneeby @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3366 - Deprecate
Orginization.edit_hookby @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3404 - Deprecate
Team.add_to_membersandTeam.remove_from_membersby @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3368 - Various minor OpenAPI fixes by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3375
- Update test key pair by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3453
- Pin CI lint Python version to 3.13 by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3406
- Improve error message on replay data mismatch by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3385 and https://github.com/PyGithub/PyGithub/pull/3386
- Disable sleeps in tests by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3383
- Update autodoc defaults by @Aidan-McNay in https://github.com/PyGithub/PyGithub/pull/3369
- Add Python 3.14 to CI and tox by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3429
- Restrict PyPi release workflow permissions by @JLLeitschuh in https://github.com/PyGithub/PyGithub/pull/3418
- Fix OpenApi workflow by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3389
- Bump codecov/codecov-action from 3 to 5 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3284
- Bump actions/setup-python from 5 to 6 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3370
- Bump dawidd6/action-download-artifact from 3.0.0 to 3.1.4 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3282
- Bump github/codeql-action from 3 to 4 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3391
- Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3394
- Bump actions/download-artifact from 5 to 6 by @dependabot[bot] in https://github.com/PyGithub/PyGithub/pull/3393
- Drop Python 3.8 support due to EOL by @hugovk in https://github.com/PyGithub/PyGithub/pull/3191
- Merge changelog updates from v2.8 release branch by @EnricoMi in https://github.com/PyGithub/PyGithub/pull/3367
New Contributors
- @odedperezcodes made their first contribution in https://github.com/PyGithub/PyGithub/pull/3382
- @Aidan-McNay made their first contribution in https://github.com/PyGithub/PyGithub/pull/3369
- @nrysk made their first contribution in https://github.com/PyGithub/PyGithub/pull/3381
- @matt-davis27 made their first contribution in https://github.com/PyGithub/PyGithub/pull/3307
Full Changelog: https://github.com/PyGithub/PyGithub/compare/v2.8.0...v2.9.0