Skip to main content

An async GitHub API library

Project description

An asynchronous GitHub API library.

Development status

https://travis-ci.org/brettcannon/gidgethub.svg?branch=master https://codecov.io/gh/brettcannon/gidgethub/branch/master/graph/badge.svg Documentation Status

Installation

Gidgethub is available on PyPI.

python3 -m pip install gidgethub

Gidgethub requires Python version 3.6 and up.

Goals

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.

Alternative libraries

If you think you want a different approach to the GitHub API, GitHub maintains a list of libraries.

Aside: what’s with the name?

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”.

Changelog

3.0.0

  • gidgethub.sansio.RateLimit.from_http returns None if ratelimit is not found in the headers.

  • Allow authenticating as a GitHub App by using JSON web token. gidgethub.sansio.create_headers now accepts jwt argument. 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, and gidgethub.abc.GitHubAPI.delete now accept jwt and oauth_token arguments.

  • gidgethub is now packaged using flit.

2.5.0

  • Tighten type hints for parameters that have a default of None but were not typed as Optional.

  • Tweak code to not change semantics but reach 100% coverage.

  • Provide a human-readable string representation of gidgethub.sansio.RateLimit.

  • Use the message data as the error message if the errors object was not returned.

  • Add the data keyword argument to gidgethub.abc.GitHubAPI.delete.

2.4.1

  • Tighten up protections against caching ineligible responses.

2.4.0

  • Expand gidgethub.routing.Router.dispatch().

2.3.0

  • Add support for application/x-www-form-urlencoded webhook event payloads. (This also allows for API calls to return this content type, although GitHub currently does not do that.)

  • Introduce gidgethub.routing to help route webhook events to registered asynchronous callbacks.

  • Add type hints.

  • Add a cache argument to gidgethub.abc.GitHubAPI.

2.2.0

  • Introduce gidgethub.tornado to support Tornado (thanks to Matthias Bussonnier and A. Jesse Jiryu Davis for the PR reviews).

2.1.0

  • The default value for the data argument of gidgethub.abc.GitHubAPI.put() was changed from "" to b"".

  • All type hints were removed (due to mypy not supporting yield in an async function, they were not being tested as being valid).

2.0.0

  • Renamed gidgethub.abc._sleep() to sleep() to make the method public.

  • Renamed the “test” extra to “tests” and added the “dev” extra.

  • Introduced the RateLimitExceeded exception.

  • Methods on GitHubAPI no 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 on Twisted[tls].

1.2.0

  • gidgethub.sansio.Event.from_http() raises a BadRequest of 415 instead of 400 when a content-type other than application/json is provided.

  • More robustly decode the body in gidgethub.sansio.Event.from_http() (i.e. if the content-type doesn’t specify charset, assume UTF-8).

  • Changed the signature of gidgethub.sansio.Event to accept Any for the data argument.

  • Fixed signature verification.

1.1.0

  • Introduced gidgethub.treq (thanks to Cory Benfield).

1.0.0

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gidgethub-3.0.0.tar.gz (103.8 kB view details)

Uploaded Source

Built Distribution

gidgethub-3.0.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file gidgethub-3.0.0.tar.gz.

File metadata

  • Download URL: gidgethub-3.0.0.tar.gz
  • Upload date:
  • Size: 103.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for gidgethub-3.0.0.tar.gz
Algorithm Hash digest
SHA256 1ebe79cf80ad64cb78c880efc7f30ac664e18b80dfd18ee201bf8685cf029628
MD5 f0aa8d24098c7c8be6c19b6b8724a551
BLAKE2b-256 f45014484271f25d90c1d3f30484bc6de7af448c66fca809f4e3920cf308ebc5

See more details on using hashes here.

Provenance

File details

Details for the file gidgethub-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: gidgethub-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for gidgethub-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9d177849f775d30f427c111dea7b260d060bc63fe668bb73f86c57998b54d3f
MD5 a83e52937cec8420ced8e2d3626a1ceb
BLAKE2b-256 809ebe2a60cd080965b419087abd27bb490806d19f3c09cd2cae12bd52647ecd

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page