Skip to main content

Drop-in wrapper around the Python Requests library that provides extra features.

Project description

Drop-in wrapper around the Requests library that provides these extra features:

  • For resiliency:

    • Retry by default (3 times in total),

    • Timeout by default (10 seconds),

    • Exception on 4xx and 5xx responses by default (automatic raise_for_status()),

  • For performance:

    • Support for Brotli enabled by default,

How to use?

  1. Replace requests with requests-extra in your dependencies file

  2. Install requests-extra package

  3. Replace requests. with requests_extra. in your code.

That’s it!

Example:

from requests_extra.api import get

get('https://httpbin.org/headers')

TODO

Tests.

And more features:

Contributing

ALL kinds of issues & PRs are very welcome! There are no formal rules of contributing yet, please use common sense. ;)

Credits

Of course big thanks to all the authors of the wrapped library, Requests!

The code for timeouts and raise_for_status() is copied from the better-requests/better-requests library. Thank you!

Some concepts from the CarlosAMolina/requests_custom library are used too. Thank you!

License

Like the wrapped Requests, and the libraries we reused, this library uses the Apache 2.0 license.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

requests_extra-1.0.0b3-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

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