Skip to main content

pico-httpx

PyPI Ask DeepWiki License: MIT CI (tox matrix) codecov Quality Gate Status Duplicated Lines (%) Maintainability Rating PyPI Downloads Docs Interactive Lab

Declarative HTTP clients for the pico ecosystem: write the interface, get the implementation. Powered by httpx.

Installation

pip install pico-httpx

Quick start

import httpx
from pico_httpx import http_client, get, post

@http_client(base_url="https://api.example.com")   # or resolve from config, see below
class UsersApi:
    @get("/users/{user_id}")
    def get_user(self, user_id: int, verbose: bool | None = None) -> dict: ...

    @post("/users")
    async def create_user(self, json: dict) -> dict: ...

    @get("/users/{user_id}/avatar")
    def avatar(self, user_id: int) -> httpx.Response: ...

The class is a regular @component — inject it anywhere. Rules:

  • {placeholders} in the path bind to method parameters.
  • A parameter named json is the request body.
  • Every other parameter becomes a query param (None values are dropped).
  • Return annotation httpx.Response gets the raw response; anything else gets response.json() (or None on an empty body). Non-2xx raises httpx.HTTPStatusError.
  • Sync stubs share an httpx.Client, async stubs an httpx.AsyncClient; both close on container shutdown.

Base URL from config instead of code:

http:
  timeout_seconds: 10
  clients:
    users:
      base_url: https://users.internal
@http_client(name="users")
class UsersApi: ...

Compose with the rest of the ecosystem: stack @retryable / @circuit_breaker (pico-resilience) on the same methods, and pico-otel traces the underlying httpx calls.

Documentation

Full documentation: https://dperezcabrera.github.io/pico-httpx/

Built for AI-assisted development

pico-httpx is part of an ecosystem designed for humans and coding agents building software together. Every package ships AGENTS.md working conventions, an llms.txt machine-readable docs index and documented behaviour pinned by regression tests; pico-testing gives agents a verification loop for their own changes, and releases are gated by the whole ecosystem booting together against real infrastructure. The full story: Built for AI-assisted development.

Install the agent skills for Claude Code or OpenAI Codex:

curl -sL https://raw.githubusercontent.com/dperezcabrera/pico-skills/main/install.sh | bash

The pico-conventions skill teaches the assistant this module's API surface and invariants; /add-component and /add-tests scaffold components and tests that use it.

License

MIT

Metadata

Release files for pico-httpx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pico-httpx 0.1.1
File Size Uploaded
pico_httpx-0.1.1.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pico-httpx 0.1.1
File Interpreter ABI Platform
pico_httpx-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / pico_httpx-0.1.1.tar.gz

Download URL pico_httpx-0.1.1.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4787c4cf158f2e201b74a90c6e9fb390754584b8c88e611309a979fb83e260df
BLAKE2b-256 checksum
How to use checksums
53aaeb19cd370042040eb461ac3a0342354e5b0fe604fb5bfd72720a9bde4f1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / pico_httpx-0.1.1-py3-none-any.whl

Download URL pico_httpx-0.1.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c35831591643d452b006154e9432724a3aca4df0665d349069649002c6525de
BLAKE2b-256 checksum
How to use checksums
10099a962d5d3d4454db885c3b08dad6a531b83acbc2f814c54d0842ac60f258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page