| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Python 3.9 reached its end-of-life October 31, 2025. Support has been removed with this release.
Full Changelog: v2.9.1...v2.10.0
Full Changelog: v2.9.0...v2.9.1
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 #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:
# 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.licenseAll 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.
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:
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.
Python 3.8 reached its end-of-life September 6, 2024. Support has been removed with this release.
Github(…, lazy=True).get_organization(…).get_hook(id).edit(…)Full Changelog: v2.8.0...v2.9.0
Full Changelog: v2.7.0...v2.8.0
Code like
gh.get_rate_limit().core.remainingshould be replaced with
gh.get_rate_limit().resources.core.remainingCode like
tag.verification["reason"]
tag.verification.get("reason")should be replaced with
tag.verification.reasonFull Changelog: v2.6.0...v2.7.0
Full Changelog: v2.6.0...v2.6.1
Code like
repo.get_views_traffic().["views"].timestamp
repo.get_clones_traffic().["clones"].timestampshould be replaced with
repo.get_views_traffic().views.timestamp
repo.get_clones_traffic().clones.timestamp| Back | FazBrowse Home | New Git URL |