pygethub
pygethub is a Python package for fetching paginated resources such as commits, users, repositories and organizations from the GitHub API. It provides automatic rate-limit handling and pagination for GitHub resources.
Features
- Get a list of commits for a specific repository.
- Get a list of branches for a specific repository.
- List GitHub users and organizations.
- List repositories for a specific organization or user.
- Get a list of contributors for a specific repository.
- Check the rate limit for the authenticated user.
- Start and resume pagination of global resources.
Installation
To install pygethub, you can use pip:
pip install pygethub
Usage
Here is an example of how you can use pygethub:
from pygethub import list_commits, GitHubPaginator, list_users
# List commits for a specific repository
commits = list_commits('owner', 'repo', 'your-github-token')
print(commits)
# Use pagination to list users
paginator = GitHubPaginator('your-github-token')
# List users from the beginning, include other request parameters as keyword arguments
users = paginator.get_paginator(list_users)
for user in users:
print(user)
# If you want to resume the listing from a certain user ID, use the `since` parameter
users = paginator.get_paginator(list_users, since=500)
for user in users:
print(user)
# Similarly, you can use the `since` parameter with list_organizations to resume listing from a certain organization ID
Development
To install pygethub, along with the tools you need to develop and run tests, run the following in your virtual environment:
pip install -e .[dev,test]
Contributing
Contributions are welcome! Please read our Contributing Guide on how to contribute to pygethub.
License
pygethub is licensed under the terms of the MIT license. See the LICENSE file for the full license text.
Metadata
Release files for pygethub 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygethub-0.1.2.tar.gz | 9.5 kB | Without provenance | Details for pygethub-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygethub-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pygethub-0.1.2-py3-none-any.whl |
Total release size: 16.6 kB
Release files / pygethub-0.1.2.tar.gz
| Download URL | pygethub-0.1.2.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9cd4d6ac0ee0d558c45e184dbddf37541f5c9c3113bc021afa39496806d21e3
|
|
BLAKE2b-256 checksum How to use checksums |
104758532f8cc01d11205c4637773e1c4a2bc2f98e3f2611ef4627d2e55bf057
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / pygethub-0.1.2-py3-none-any.whl
| Download URL | pygethub-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edc84bcd6d1a9158faff41abd5e9a063c693bac4fc261fd844a8a8c61da84e1a
|
|
BLAKE2b-256 checksum How to use checksums |
d7660917fd4fbeb515934a70daebf17b4f0948a4ec79b1019d61994348bde9dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for pygethub 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.