freshcrate
Skin:/
Home > RAG & Memory > ghapi

ghapi

A python client for the GitHub API

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

# ghapi <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --> [`ghapi`](https://ghapi.fast.ai/cli.html#ghapi) provides 100% always-updated coverage of the entire [GitHub API](https://docs.github.com/rest). Because we automatically convert the [OpenAPI spec](https://docs.github.com/rest/overview/openapi-description) to a Pythonic API, [`ghapi`](https://ghapi.fast.ai/cli.html#ghapi) is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size! Using [`ghapi`](https://ghapi.fast.ai/cli.html#ghapi), you can automate nearly anything that you can do through the GitHub web interface or through the `git` client, such as: - Open, list, comment on, or modify [issues](https://guides.github.com/features/issues/) or [pull requests](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/about-pull-requests) - Create, list, or modify [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) or [GitHub releases](https://docs.github.com/github/administering-a-repository/managing-releases-in-a-repository), including uploading release assets - Configure and run GitHub [Actions](https://github.com/features/actions) and [webhooks](https://docs.github.com/developers/webhooks-and-events/about-webhooks) - Set up GitHub [users](https://docs.github.com/rest/reference/users) and [organizations](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-organizations) - Manage your [deployments](https://docs.github.com/rest/guides/delivering-deployments) - โ€ฆand much, much more. There are two ways to use [`ghapi`](https://ghapi.fast.ai/cli.html#ghapi): either through Python, or from the command line. An overview of each is provided below. ## Installation To install, run either `pip install ghapi` or `conda install -c fastai ghapi`. ## How to use - Python Throughout this documentation, you will see code inputs and outputs shown in this format: ``` python 1+1 ``` 2 We recommend reading the documentation on the [official site](https://ghapi.fast.ai/), rather than on GitHub, since not all the functionality described on this page is available through the GitHub viewer. All of the documentation is available directly as Jupyter Notebooks, for instance the current page youโ€™re reading is available as a notebook [here](https://github.com/fastai/ghapi/blob/master/index.ipynb). To open any page as an interactive notebook in Google Colab, click the *Colab* badge at the top of the page. To access the GitHub API, first create a [`GhApi`](https://ghapi.fast.ai/core.html#ghapi) object: ``` python from ghapi.all import GhApi api = GhApi() ``` Every part of the API includes documentation directly in the `api` object itself. For instance, hereโ€™s how to explore the groups of functionality provided by the API by displaying the object: ``` python api ``` - [actions](https://docs.github.com/rest/reference/actions) - [activity](https://docs.github.com/rest/reference/activity) - [api_insights](https://docs.github.com/rest/reference/api-insights) - [apps](https://docs.github.com/rest/reference/apps) - [billing](https://docs.github.com/rest/reference/billing) - [checks](https://docs.github.com/rest/reference/checks) - [classroom](https://docs.github.com/rest/reference/classroom) - [code_scanning](https://docs.github.com/rest/reference/code-scanning) - [code_security](https://docs.github.com/rest/reference/code-security) - [codes_of_conduct](https://docs.github.com/rest/reference/codes-of-conduct) - [codespaces](https://docs.github.com/rest/reference/codespaces) - [copilot](https://docs.github.com/rest/reference/copilot) - [dependabot](https://docs.github.com/rest/reference/dependabot) - [dependency_graph](https://docs.github.com/rest/reference/dependency-graph) - [emojis](https://docs.github.com/rest/reference/emojis) - [gists](https://docs.github.com/rest/reference/gists) - [git](https://docs.github.com/rest/reference/git) - [gitignore](https://docs.github.com/rest/reference/gitignore) - [hosted_compute](https://docs.github.com/rest/reference/hosted-compute) - [interactions](https://docs.github.com/rest/reference/interactions) - [issues](https://docs.github.com/rest/reference/issues) - [licenses](https://docs.github.com/rest/reference/licenses) - [markdown](https://docs.github.com/rest/reference/markdown) - [meta](https://docs.github.com/rest/reference/meta) - [migrations](https://docs.github.com/rest/reference/migrations) - [oidc](https://docs.github.com/rest/reference/oidc) - [orgs](https://docs.github.com/rest/reference/orgs) - [packages](https://docs.github.com/rest/reference/packages) - [private_registries](https://docs.github.com/rest/reference/private-registries) - [projects](https://docs.github.com/rest/reference/projects) - [pulls](https://docs.github.com/rest/reference/pulls) - [rate_limit](https://docs.github.com/rest/reference/rate-limit) - [reactions](https://doc

Release History

VersionChangesUrgencyDate
2.1.3### New Features - Import APIError from fasttransport ([#237](https://github.com/AnswerDotAI/ghapi/pull/237)), thanks to [@jph00](https://github.com/jph00) - Extract failed step logs from workflow run log zip archive, stripping ANSI codes, instead of parsing job logs by timestamp ([#235](https://github.com/AnswerDotAI/ghapi/issues/235)) ### Bugs Squashed - Update CLI flags for fastcore.script hyphenation ([#236](https://github.com/AnswerDotAI/ghapi/pull/236)), thanks to [@jph00](https://githuHigh9/1/2026
2.1.2### New Features - Migrate transport import to fasttransport.core ([#234](https://github.com/AnswerDotAI/ghapi/issues/234)) - Add MAXLEN constant (180) for display line truncation and use it as default maxlen ([#233](https://github.com/AnswerDotAI/ghapi/issues/233)) - Truncate PR and failed-step-log output to 8k chars, show no PRs for empty PR lists ([#232](https://github.com/AnswerDotAI/ghapi/issues/232))High8/13/2026
2.0.5### New Features - Use public `mk_groups` from fastcore instead of private `_build_groups` ([#225](https://github.com/AnswerDotAI/ghapi/issues/225))High7/31/2026
2.0.3### New Features - Add `commit_tree` method to atomically create or update a branch with multiple file entries in a single commit ([#221](https://github.com/AnswerDotAI/ghapi/issues/221))High7/22/2026
2.0.1### New Features - Support repository issue templates in GhApi ([#219](https://github.com/AnswerDotAI/ghapi/issues/219)) - Make load_gist and gist_file sync-compatible by removing hard async, using `then` for lazy chaining ([#217](https://github.com/AnswerDotAI/ghapi/issues/217)) - Skill improvements and allow policies ([#215](https://github.com/AnswerDotAI/ghapi/pull/215)), thanks to [@KeremTurgutlu](https://github.com/KeremTurgutlu)Medium7/11/2026
1.0.15### New Features - Add ghapi.skill ([#210](https://github.com/AnswerDotAI/ghapi/issues/210)) - Add gist helpers, `read_issue`/`read_pr`, and `check_status` methods; use threadpool for `get_repo_contents` ([#209](https://github.com/AnswerDotAI/ghapi/issues/209))High7/4/2026
1.0.14### Bugs Squashed - Fixes missing dep: Add 'gql' dependency to pyproject.toml ([#207](https://github.com/AnswerDotAI/ghapi/pull/207)), thanks to [@RensDimmendaal](https://github.com/RensDimmendaal)High6/22/2026
1.0.13Imported from PyPI (1.0.13)Low4/21/2026
1.0.12### New Features - Use Content-Type to determine response parsing ([#205](https://github.com/AnswerDotAI/ghapi/pull/205)), thanks to [@erikgaas](https://github.com/erikgaas)Low2/27/2026
1.0.11### New Features - Use Content-Type to determine response parsing ([#205](https://github.com/AnswerDotAI/ghapi/pull/205)), thanks to [@erikgaas](https://github.com/erikgaas)Low2/27/2026
1.0.10### New Features - `GhApi.get_repo_contents` method ([#190](https://github.com/AnswerDotAI/ghapi/pull/190)), thanks to [@KeremTurgutlu](https://github.com/KeremTurgutlu)Low1/20/2026
1.0.9### New Features - Update API ([#203](https://github.com/AnswerDotAI/ghapi/issues/203)) - Add GraphQL support ([#202](https://github.com/AnswerDotAI/ghapi/pull/202)), thanks to [@erikgaas](https://github.com/erikgaas) - Support for Python 3.13 and 3.14 ([#200](https://github.com/AnswerDotAI/ghapi/pull/200)), thanks to [@hugovk](https://github.com/hugovk) - Add py.typed file so that typecheckers recognize this library as typed ([#194](https://github.com/AnswerDotAI/ghapi/pull/194)), thanks to [@Low1/15/2026
1.0.8### Bugs Squashed - rm `GitPython` dep ([#199](https://github.com/AnswerDotAI/ghapi/pull/199)), thanks to [@KeremTurgutlu](https://github.com/KeremTurgutlu)Low9/16/2025
1.0.7### New Features - Avoid quoting slash, thanks @soemiran ([#196](https://github.com/AnswerDotAI/ghapi/issues/196)) - Create gist with imgs ([#195](https://github.com/AnswerDotAI/ghapi/pull/195)), thanks to [@KeremTurgutlu](https://github.com/KeremTurgutlu)Low9/16/2025
1.0.6### New Features - Automatically decode response based on path ([#183](https://github.com/fastai/ghapi/pull/183)), thanks to [@radam9](https://github.com/radam9) - Expose timeout [#174](https://github.com/fastai/ghapi/pull/174)), thanks to [@HarikrishnanBalagopal](https://github.com/HarikrishnanBalagopal) ### Bugs Squashed - Github now requires branch, author, and committer in file update calls ([#184](https://github.com/fastai/ghapi/issues/184)) - Remove the check which removes `None` valuesLow8/31/2024
1.0.3### New Features - add `authenticate` arg which allows unauthenticated `GhApi` clients even if `GITHUB_TOKEN` is set ([#150](https://github.com/fastai/ghapi/pull/150)), thanks to [@seeM](https://github.com/seeM)Low9/13/2022
1.0.1### New Features - warn if no GitHub token found ([#145](https://github.com/fastai/ghapi/issues/145)) - set `GITHUB_DEBUG=1` to print requests sent to GitHubLow8/21/2022
1.0.0### New Features - add `delete_file` and `create_file` ([#143](https://github.com/fastai/ghapi/issues/143)) - Add a "Documentation" link to the sidebar on PyPI ([#106](https://github.com/fastai/ghapi/pull/106)), thanks to [@nedbat](https://github.com/nedbat) - Add support for media types ([#102](https://github.com/fastai/ghapi/pull/102)), thanks to [@lfdebrux](https://github.com/lfdebrux) ### Bugs Squashed - Fix links to GitHub docs ([#136](https://github.com/fastai/ghapi/pull/136)), thanks tLow7/23/2022
0.1.23### New Features - add `delete_file` and `create_file` ([#143](https://github.com/fastai/ghapi/issues/143)) - Add a "Documentation" link to the sidebar on PyPI ([#106](https://github.com/fastai/ghapi/pull/106)), thanks to [@nedbat](https://github.com/nedbat) - Add support for media types ([#102](https://github.com/fastai/ghapi/pull/102)), thanks to [@lfdebrux](https://github.com/lfdebrux) ### Bugs Squashed - Fix links to GitHub docs ([#136](https://github.com/fastai/ghapi/pull/136)), thanks tLow7/23/2022
0.1.21### Bugs Squashed - fix `create_gist`Low6/13/2022
0.1.20### New Features - add `create_gist` ([#129](https://github.com/fastai/ghapi/issues/129)) ### Bugs Squashed - `HTTP Error 422: Unprocessable Entity` returned for `issues.add_labels` in version `0.1.17` ([#69](https://github.com/fastai/ghapi/issues/69))Low4/9/2022
0.1.19### New Features - Remove need to URL-quote some parameters ([#54](https://github.com/fastai/ghapi/issues/54))Low7/10/2021
0.1.18### Bugs Squashed - `HTTP Error 422: Unprocessable Entity` returned for `issues.add_labels` ([#69](https://github.com/fastai/ghapi/issues/69))Low7/9/2021
0.1.17### Bugs Squashed - Fix ability to define scopes ([#53](https://github.com/fastai/ghapi/pull/53)), thanks to [@danpalmer](https://github.com/danpalmer)Low5/24/2021
0.1.15### New Features - make `actions_group` a context manager ([#33](https://github.com/fastai/ghapi/issues/33))Low1/21/2021
0.1.14### New Features - `text` property for `GhEvent` ([#23](https://github.com/fastai/ghapi/issues/23)) ### Bugs Squashed - broken links in index.html page ([#27](https://github.com/fastai/ghapi/issues/27)) - Bug: `paged` does not pass `kwargs` to operation ([#24](https://github.com/fastai/ghapi/issues/24))Low1/4/2021
0.1.13### Bugs Squashed - missing import in auth ([#21](https://github.com/fastai/ghapi/issues/21))Low12/14/2020
0.1.11### Bugs Squashed - missing webbrowser import ([#20](https://github.com/fastai/ghapi/issues/20))Low12/14/2020
0.1.10- Add `load_sample_events`, which loads a file of 1000 sample public eventsLow12/13/2020
0.1.8### New Features - add `fetch_events` ([#19](https://github.com/fastai/ghapi/issues/19))Low12/12/2020
0.1.7### New Features - parallel `pages` ([#18](https://github.com/fastai/ghapi/issues/18)) - add `GhDeviceAuth` ([#15](https://github.com/fastai/ghapi/issues/15)) - add `date2gh` ([#14](https://github.com/fastai/ghapi/issues/14))Low12/12/2020
0.1.6Release 0.1.6Low12/7/2020
0.1.10.1.1 ### New Features - add `list_tags` and `list_branches` ([#2](https://github.com/fastai/ghapi/issues/2)) ### Bugs Squashed - `GhApi` pickle recursion error ([#3](https://github.com/fastai/ghapi/issues/3))Low11/26/2020
0.1.00.1.0 - First release with full API coverageLow11/26/2020

Dependencies & License Audit

Loading dependencies...

Similar Packages

banksA prompt programming languagemain@2026-09-10
pytorch-lightningPyTorch Lightning is the lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.2.6.6
cadwynProduction-ready community-driven modern Stripe-like API versioning in FastAPI7.3.0
boxsdkOfficial Box Python SDKv10.15.0
django-cors-headersdjango-cors-headers is a Django application for handling the server headers required for Cross-Origin Resource Sharing (CORS).main@2026-09-07

More from pypi

markitdownUtility tool for converting various files to Markdown
fastapiFastAPI framework, high performance, easy to learn, fast to code, ready for production
djangoA high-level Python web framework that encourages rapid development and clean, pragmatic design.
flaskA simple framework for building complex web applications.

More in RAG & Memory

pytorch-lightningPyTorch Lightning is the lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.
banksA prompt programming language
opikDebug, evaluate, and monitor your LLM applications, RAG systems, and agentic workflows with comprehensive tracing, automated evaluations, and production-ready dashboards.
pdf_oxideThe fastest PDF library for Python and Rust. Text extraction, image extraction, markdown conversion, PDF creation & editing. 0.8ms mean, 5ร— faster than industry leaders, 100% pass rate on 3,830 PDFs.