pygethub


Namepygethub JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryFetch data from GitHub
upload_time2024-02-22 22:50:37
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Gregory Lindsey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords github api fetch data json
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pygethub
[![Build](https://github.com/chrisammon3000/pygethub/actions/workflows/run_tests.yml/badge.svg?style=for-the-badge)](https://github.com/chrisammon3000/pygethub/actions/workflows/run_tests.yml) [![codecov](https://codecov.io/github/chrisammon3000/pygethub/branch/main/graph/badge.svg?token=QSZLP51RWJ)](https://codecov.io/github/chrisammon3000/pygethub?style=for-the-badge) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)

**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`:

<!-- TODO Add example of using paginator with params, see gfe-db notebook for GitHub EDA list_branches -->
```python
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](CONTRIBUTING.md) on how to contribute to `pygethub`.

## License

`pygethub` is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for the full license text.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pygethub",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "github,api,fetch,data,json",
    "author": "",
    "author_email": "\"@chrisammon3000\" <gclindsey@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/10/47/58532f8cc01d11205c4637773e1c4a2bc2f98e3f2611ef4627d2e55bf057/pygethub-0.1.2.tar.gz",
    "platform": null,
    "description": "# pygethub\n[![Build](https://github.com/chrisammon3000/pygethub/actions/workflows/run_tests.yml/badge.svg?style=for-the-badge)](https://github.com/chrisammon3000/pygethub/actions/workflows/run_tests.yml) [![codecov](https://codecov.io/github/chrisammon3000/pygethub/branch/main/graph/badge.svg?token=QSZLP51RWJ)](https://codecov.io/github/chrisammon3000/pygethub?style=for-the-badge) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)\n\n**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.\n\n## Features\n\n- Get a list of commits for a specific repository.\n- Get a list of branches for a specific repository.\n- List GitHub users and organizations.\n- List repositories for a specific organization or user.\n- Get a list of contributors for a specific repository.\n- Check the rate limit for the authenticated user.\n- Start and resume pagination of global resources.\n\n## Installation\n\nTo install `pygethub`, you can use pip:\n\n```\npip install pygethub\n```\n\n## Usage\n\nHere is an example of how you can use `pygethub`:\n\n<!-- TODO Add example of using paginator with params, see gfe-db notebook for GitHub EDA list_branches -->\n```python\nfrom pygethub import list_commits, GitHubPaginator, list_users\n\n# List commits for a specific repository\ncommits = list_commits('owner', 'repo', 'your-github-token')\nprint(commits)\n\n# Use pagination to list users\npaginator = GitHubPaginator('your-github-token')\n\n# List users from the beginning, include other request parameters as keyword arguments\nusers = paginator.get_paginator(list_users)\nfor user in users:\n    print(user)\n\n# If you want to resume the listing from a certain user ID, use the `since` parameter\nusers = paginator.get_paginator(list_users, since=500)\nfor user in users:\n    print(user)\n\n# Similarly, you can use the `since` parameter with list_organizations to resume listing from a certain organization ID\n```\n\n## Development\n\nTo install `pygethub`, along with the tools you need to develop and run tests, run the following in your virtual environment:\n\n```\npip install -e .[dev,test]\n```\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) on how to contribute to `pygethub`.\n\n## License\n\n`pygethub` is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for the full license text.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Gregory Lindsey  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Fetch data from GitHub",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [
        "github",
        "api",
        "fetch",
        "data",
        "json"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7660917fd4fbeb515934a70daebf17b4f0948a4ec79b1019d61994348bde9dc",
                "md5": "33059ed8cc88d999f38c8981459deb1b",
                "sha256": "edc84bcd6d1a9158faff41abd5e9a063c693bac4fc261fd844a8a8c61da84e1a"
            },
            "downloads": -1,
            "filename": "pygethub-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33059ed8cc88d999f38c8981459deb1b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7151,
            "upload_time": "2024-02-22T22:50:35",
            "upload_time_iso_8601": "2024-02-22T22:50:35.449591Z",
            "url": "https://files.pythonhosted.org/packages/d7/66/0917fd4fbeb515934a70daebf17b4f0948a4ec79b1019d61994348bde9dc/pygethub-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "104758532f8cc01d11205c4637773e1c4a2bc2f98e3f2611ef4627d2e55bf057",
                "md5": "2aca262b9d087a937d073ad4925a71aa",
                "sha256": "c9cd4d6ac0ee0d558c45e184dbddf37541f5c9c3113bc021afa39496806d21e3"
            },
            "downloads": -1,
            "filename": "pygethub-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2aca262b9d087a937d073ad4925a71aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9461,
            "upload_time": "2024-02-22T22:50:37",
            "upload_time_iso_8601": "2024-02-22T22:50:37.711015Z",
            "url": "https://files.pythonhosted.org/packages/10/47/58532f8cc01d11205c4637773e1c4a2bc2f98e3f2611ef4627d2e55bf057/pygethub-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-22 22:50:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pygethub"
}
        
Elapsed time: 0.19096s