Skip to main content

Rate Limiting and Caching HTTPX Client

Project description

HTTPX Wrapper with Rate Limiting and Caching Transports.

PyPI Version

BuildRelease Tests Coverage badge

Introduction

The goal of this project is convenience - leveraging existing rate limiting and caching libraries with a more convenient interface and abstract away certain decisions.

This came about while implementing caching & rate limiting for edgartools: reducing network requests and improving overall performance led to a rabbit hole of decisions. The SEC's Edgar site has a strict 10 request per second limit, while providing not-very-helpful caching headers. Overriding these caching headers with custom rules has a significant performance improvement.

Caching

This project builds on Hishel to provide:

  • Easily configurable File Storage and (TBD) AWS S3 Storage

  • Cache Controller driven by rules, defined as:

    {
        'site_regex': {
            'url_regex': duration
        }
    }
    

    duration is int | bool:

    • int: # of seconds to treat the file as unchanged: the file will not be revalidated during this period
    • true: infinite caching - never re-validate
  • Rate Limiting supporting local rate limits, multiprocessing rate limiting, and distributed rate limiting.

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

httpxthrottlecache-0.1.4.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpxthrottlecache-0.1.4-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file httpxthrottlecache-0.1.4.tar.gz.

File metadata

  • Download URL: httpxthrottlecache-0.1.4.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for httpxthrottlecache-0.1.4.tar.gz
Algorithm Hash digest
SHA256 808b44488a513bae9cc08b10f03e14307b2f3fa9c7efe779725ccea1d5fe80a1
MD5 a4d4213ebdbbf0ef9c8af6745891d4ec
BLAKE2b-256 3c054e88c885be105b0dd06419b8454a6cbac4790bc8d97f47875b36a23efd46

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpxthrottlecache-0.1.4.tar.gz:

Publisher: build_deploy.yml on paultiq/httpxthrottlecache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file httpxthrottlecache-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for httpxthrottlecache-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e98a0fbca52905346942f472e87eca0a7a1b7e96d0690386ca5aff5bf746ca50
MD5 7aa48b3093b5a6c887ba3c988b212d8a
BLAKE2b-256 03869c75c98e0f9669289fbcaa2559d660c69bb62b03350e322384099ebeb157

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpxthrottlecache-0.1.4-py3-none-any.whl:

Publisher: build_deploy.yml on paultiq/httpxthrottlecache

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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