Server status ...

magogi/prod/: mgf-http-0.4.11 metadata and description

Simple index Newer version available

Async HTTP client for mgf-common consumers — typed httpx wrapper with retries, timeouts, header redaction, OTel-aware logging. Sibling of mgf-common under the mgf.* namespace.

author Bassam Alsanie, mgf-http contributors
classifiers
  • Development Status :: 3 - Alpha
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • Operating System :: MacOS
  • Operating System :: Microsoft :: Windows
  • Operating System :: POSIX :: Linux
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: 3.13
  • Topic :: Internet :: WWW/HTTP
  • Topic :: Software Development :: Libraries
  • Typing :: Typed
description_content_type text/markdown
keywords async, http-client, httpx, otel, redaction, retry
license MIT
license_file
  • LICENSE
project_urls
  • Homepage, https://codeberg.org/magogi-admin/mgf-http
  • Issues, https://codeberg.org/magogi-admin/mgf-http/issues
  • Changelog, https://codeberg.org/magogi-admin/mgf-http/src/branch/main/CHANGELOG.md
requires_dist
  • httpx>=0.27
  • mgf-common<0.50,>=0.41
  • hypothesis>=6.100; extra == 'dev'
  • import-linter>=2.0; extra == 'dev'
  • mgf-test-supervisor<0.2,>=0.1.3; extra == 'dev'
  • mypy>=1.10; extra == 'dev'
  • pytest-asyncio>=0.23; extra == 'dev'
  • pytest-cov>=5.0; extra == 'dev'
  • pytest-timeout<3,>=2.3; extra == 'dev'
  • pytest>=8.0; extra == 'dev'
  • respx>=0.21; extra == 'dev'
  • ruff<0.16,>=0.4; extra == 'dev'
  • mgf-common[standards]<0.50,>=0.46; extra == 'standards'
  • respx>=0.21; extra == 'test'
requires_python >=3.11

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
mgf_http-0.4.11-py3-none-any.whl
Size
27 KB
Type
Python Wheel
Python
3
mgf_http-0.4.11.tar.gz
Size
196 KB
Type
Source

mgf-http — typed async HTTP client for mgf-common consumers

Registry Python

Shape: Federation sibling of mgf-common. The current mgf-common pin window is shown in this package's Codeberg registry — sourced from pyproject.toml at release time, so this README can't go stale. (Per v2.6 DOC-01 / project-shape taxonomy. PAPER-38.)

Sibling of mgf-common under the mgf.* namespace. Houses the typed httpx wrapper that previously lived under mgf.common.http.* — extracted at mgf-common v0.29 / mgf-http v0.1 per the federation split plan.

What this provides

Submodule What
mgf.http AsyncHttpClient — thin wrapper over httpx.AsyncClient with retries, timeouts, header redaction, OTel-aware logging, typed error translation. RetryPolicy — exponential backoff with jitter; per-request override.
mgf.http.exceptions HttpTransportError(OperationError) — transport-layer failure (timeout, connect-refused, network unreachable). Renamed from HttpClientError at the v0.29 cutover to disambiguate from mgf.common.exceptions.HttpClientError (the HTTP-01 4xx-class hierarchy parent, which stays in mgf-common).

Install

pip install mgf-http
# Or with the test extra (respx for mocking httpx in your tests):
pip install 'mgf-http[test]'

Pulls in mgf-common and httpx automatically.

Quick start

import asyncio
from mgf.http import AsyncHttpClient, RetryPolicy

async def main() -> None:
    async with AsyncHttpClient(
        base_url="https://api.example.com",
        timeout=10.0,
        retry=RetryPolicy(max_attempts=3),
    ) as http:
        response = await http.get("/users", params={"page": 1})
        response.raise_for_status()
        users = response.json()

asyncio.run(main())

The client auto-derives a User-Agent of the shape <app>/<ver> mgf-http/<libver> from mgf.common.app_name() / mgf.common.app_version() (call mgf.common.bootstrap() at startup for accurate identity). Authorization / Cookie / X-Api-Key family headers are redacted in logs and OTel spans automatically.

Documentation

For the federation-wide engineering standards (DESIGN_PRINCIPLES, ERROR_HANDLING, SECURITY, etc.) see mgf-standard/docs/standards/. This sibling inherits them by reference; the standards source-of-truth lives in mgf-common.

Conformance: L2 per mgf-standard/docs/standards/. Per-rule audit ledger: docs/inprogress/MGF_STANDARDS_CONFORMANCE.md. L2 means every federation MUST rule applies, evidenced by the tracker.

Status

🚧 Experimental — every public name is experimental per AP-09. Promotion to stable happens release-by-release as consumer feedback in mgf-common/FEEDBACK.md converges. The 0.x window applies. Pin tightly: mgf-http = ">=0.X.0,<0.Y".

Cross-references