Skip to main content

General Utilities

Project description

Wardy Utils

Wardy Utils is a collection of general-purpose utilities designed to simplify and enhance your Python scripting experience. This library provides reusable components that can be integrated into your projects to save time and effort.

Features

HTTP Utilities

  • http: A high-level HTTP client built on top of httpx and hishel, setting some caching and timeout comment settings.

Installation

To install Wardy Utils, use pip:

pip install wardy-utils

Usage

HTTP Client Example

from wardy_utils.web import cached_client

client = cached_client()
response = client.get("https://example.com")
print(response.text)

Convenience singletons live in wardy_utils.web if you want ready-made instances without wiring:

  • sync_client: default sync client.
  • sync_force_client: sync client that ignores origin cache headers.
  • async_client: default async client.
  • async_force_client: async client that ignores origin cache headers.

Environment overrides for the HTTP client:

Variable Description Default
WARDY_UTILS_CACHE_DIR Directory for the sqlite cache file. In-memory
WARDY_UTILS_CACHE_FILENAME Filename for the sqlite cache file when a cache directory is set. wardy-utils-cache.sqlite
WARDY_UTILS_CACHE_TTL Cache TTL in seconds. 1800
WARDY_UTILS_TIMEOUT Request timeout in seconds. 45
WARDY_UTILS_FORCE_CACHE If truthy, ignore origin cache-control headers. Disabled
WARDY_UTILS_HTTP2 Enable or disable HTTP/2. Enabled

Proxy behaviour: the client inherits proxy settings from standard http_proxy, https_proxy, and all_proxy environment variables, so you can point traffic via your organisation's proxy without code changes.

Requirements

  • Python 3.13.3 or higher

Contributing

Contributions are welcome! Run the test suite with coverage via:

pytest --cov=src --cov-report=xml

Feel free to open issues or submit pull requests to improve the library.

License

This project is licensed under the MIT License.

Author

Created by Wardy
Email: wardy3+gitlab@gmail.com

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

wardy_utils-0.3.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

wardy_utils-0.3.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file wardy_utils-0.3.0.tar.gz.

File metadata

  • Download URL: wardy_utils-0.3.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wardy_utils-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f5df1eacd904b6ecd3b0387aa1eadfb0fad80b97f3ed3a1f2796c24a831a66f0
MD5 ae7fe3a89b6edb98175d5122a609a149
BLAKE2b-256 037c5a418082179d3dfb288c6316397ef1cd5ccc0d18bd6065045862e5015df0

See more details on using hashes here.

File details

Details for the file wardy_utils-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wardy_utils-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wardy_utils-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bed90e2ad717fa281ebe88e4c8773881f202149cfc610acc0b43292375d0c4f5
MD5 38cd5f4cf0cf7087602121bc908c04f7
BLAKE2b-256 39cd913fcb75050b2606df33125d52f13824cee717177188077ae14b2723d5d3

See more details on using hashes here.

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