Skip to main content

Introspect Pyramid views and generate an HTTP client for the app

Project description

pyramid-client-builder

PyPI version Python versions License: MIT

Introspect a Pyramid application and generate typed HTTP clients — like protoc for gRPC, but for your Pyramid REST API. Generates Python and Go clients in a single invocation.

What it does

pclient-build boots your Pyramid app from its INI file, discovers routes and Cornice services, and generates client packages for multiple languages and HTTP transports. Each variant is written to its own subdirectory.

Pyramid app (INI file)
  → introspect routes, views, schemas
  → generate all client variants:
      python_requests/   (Python + requests)
      python_httpx/      (Python + httpx)
      go/                (Go + net/http)

Quick example

Generate clients from your payments service:

pclient-build development.ini --name payments --output ./generated/

Use the Python client:

from payments_client.client import PaymentsClient

client = PaymentsClient(base_url="http://localhost:6543")

# Methods are named from your URL paths
charges = client.list_charges()
charge = client.get_charge(id=42)
new_charge = client.create_charge(amount=1000, currency="usd")
client.cancel_charge(id=42)

# Versioned APIs get sub-clients
items = client.v1.list_items()

Use the Go client:

import "payments-client"

client := paymentsclient.NewClient(
    "http://localhost:6543",
    paymentsclient.WithAuthToken("your-token"),
)

charges, err := client.V1.ListCharges(nil)
charge, err := client.V1.GetCharge("42")
newCharge, err := client.V1.CreateCharge(&v1.ChargesRequestSchema{
    Amount:   1000,
    Currency: "usd",
})

Installation

pip install pyramid-client-builder

Or with uv:

uv add pyramid-client-builder

Documentation

Full documentation is available at the project docs site, including:

Development

git clone https://github.com/cartaorobbin/pyramid-client-builder.git
cd pyramid-client-builder
uv sync --dev

Run tests:

uv run pytest          # single Python version
uv run tox             # full matrix (3.10–3.13)

Lint and format:

uv run ruff check .
uv run black .

Build docs locally:

uv run mkdocs serve

License

MIT

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

pyramid_client_builder-0.14.7.tar.gz (165.8 kB view details)

Uploaded Source

Built Distribution

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

pyramid_client_builder-0.14.7-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

Details for the file pyramid_client_builder-0.14.7.tar.gz.

File metadata

  • Download URL: pyramid_client_builder-0.14.7.tar.gz
  • Upload date:
  • Size: 165.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyramid_client_builder-0.14.7.tar.gz
Algorithm Hash digest
SHA256 6f091bf529c0360bf35d75f733244bb3585928f89db8497b5fa420b39117d78e
MD5 ad3d54cafd74e52fa08bb7800715c88c
BLAKE2b-256 b21704656bf36591cb7b0d395e9c3512cc6f388cacc20cb5046b94495d17d778

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyramid_client_builder-0.14.7.tar.gz:

Publisher: ci.yml on cartaorobbin/pyramid-client-builder

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

File details

Details for the file pyramid_client_builder-0.14.7-py3-none-any.whl.

File metadata

File hashes

Hashes for pyramid_client_builder-0.14.7-py3-none-any.whl
Algorithm Hash digest
SHA256 368883c6ac28aaeb04b4fcef0fa03c1a52ac83bcc860cfa731450fe33e7f7bdc
MD5 79985f68ab359647e4f457fa4b1aa522
BLAKE2b-256 0df000a5348b7323fda4e073923895bb6e09aefa1049e9a56497d50d5c0075c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyramid_client_builder-0.14.7-py3-none-any.whl:

Publisher: ci.yml on cartaorobbin/pyramid-client-builder

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