An asynchronous GitHub API library.
Gidgethub is available on PyPI.
python3 -m pip install gidgethub
Gidgethub requires Python version 3.6 and up.
The key goal is to provide a base library for the GitHub API which performs no I/O of its own (a sans-I/O library). This allows users to choose whatever HTTP library they prefer while parceling out GitHub-specific details to this library. This base library is then built upon to provide an abstract base class to a cleaner API to work with. Finally, implementations of the abstract base class are provided for asynchronous HTTP libraries for immediate usage.
If you think you want a different approach to the GitHub API, GitHub maintains a list of libraries.
I couldn't think of a good name that was somehow a play on "GitHub" or somehow tied into Monty Python. And so I decided to play off of GitHub's octocat as a theme and use my cat's name, Gidget, as part of the name. Since "Gidget" somewhat sounds like "git", I decided to go with "gidgethub".
gidgethub.abc.GitHubAPI.getiter()now works with GitHub's search API (thanks Pablo Galindo).
gidgethub.sansio.RateLimit.from_httpreturnsNoneif ratelimit is not found in the headers.- Allow authenticating as a GitHub App by using JSON web token.
gidgethub.sansio.create_headersnow acceptsjwtargument.gidgethub.abc.GitHubAPI._make_request,gidgethub.abc.GitHubAPI.getitem,gidgethub.abc.GitHubAPI.getiter,gidgethub.abc.GitHubAPI.post,gidgethub.abc.GitHubAPI.patch,gidgethub.abc.GitHubAPI.put, andgidgethub.abc.GitHubAPI.deletenow acceptjwtandoauth_tokenarguments. - gidgethub is now packaged using flit.
- Tighten type hints for parameters that have a default of
Nonebut were not typed asOptional. - Tweak code to not change semantics but reach 100% coverage.
- Provide a human-readable string representation of
gidgethub.sansio.RateLimit. - Use the
messagedata as the error message if theerrorsobject was not returned. - Add the data keyword argument to
gidgethub.abc.GitHubAPI.delete.
- Tighten up protections against caching ineligible responses.
- Expand
gidgethub.routing.Router.dispatch().
- Add support for
application/x-www-form-urlencodedwebhook event payloads. (This also allows for API calls to return this content type, although GitHub currently does not do that.) - Introduce
gidgethub.routingto help route webhook events to registered asynchronous callbacks. - Add type hints.
- Add a cache argument to
gidgethub.abc.GitHubAPI.
- Introduce
gidgethub.tornadoto support Tornado (thanks to Matthias Bussonnier and A. Jesse Jiryu Davis for the PR reviews).
- The default value for the data argument of
gidgethub.abc.GitHubAPI.put()was changed from""tob"". - All type hints were removed (due to mypy not supporting yield in an async function, they were not being tested as being valid).
- Renamed
gidgethub.abc._sleep()tosleep()to make the method public. - Renamed the "test" extra to "tests" and added the "dev" extra.
- Introduced the
RateLimitExceededexception. - Methods on
GitHubAPIno longer automatically sleep when it's possible that the call will exceed the user's rate limit (it's now up to the user to prevent from going over the rate limit). - Made the
[treq]install extra depend onTwisted[tls].
gidgethub.sansio.Event.from_http()raises aBadRequestof415instead of400when a content-type other thanapplication/jsonis provided.- More robustly decode the body in
gidgethub.sansio.Event.from_http()(i.e. if thecontent-typedoesn't specifycharset, assumeUTF-8). - Changed the signature of
gidgethub.sansio.Eventto acceptAnyfor the data argument. - Fixed signature verification.
- Introduced
gidgethub.treq(thanks to Cory Benfield).
Initial release.