Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

APIZIT Linking

Python APIs with clear context for AI. Keep the code. Add the API. Write and test ordinary Python functions, define the HTTP contract separately, and follow a route straight back to its source.

Linking is a standalone declarative JSON API framework. Its core requires PyYAML; FastAPI serving and Pydantic models are optional extras. It needs no APIZIT account.

Documentation · Quickstart · Fork the examples · Issues

# customer_service.py — existing business code stays unchanged
def create_customer(customer_name: str, age: int):
    return {"name": customer_name, "age": age}
version: 1
routes:
  - path: /customers
    method: POST
    function: customer_service:create_customer
    parameters:
      customer_name:
        source: {location: body, name: name}
      age:
        source: {location: body, name: age}
    response: {status: 201}

Evaluate the 1.0 candidate

Python 3.10–3.14, Apache-2.0. Pin the exact release candidate during evaluation. PyPI is the authority for published versions; 0.5.0 is the preceding stable beta.

python -m pip install "apizit-linking[preview,models]==1.0.0rc1"
apizit-linking validate . --json
apizit-linking preview . --port 8080

For static tooling alone, install apizit-linking==1.0.0rc1. Validation parses the manifest and Python AST without importing customer code. Preview imports trusted code, binds to loopback by default and requires --allow-network for other hosts. It is a development server; serve with ASGI for an application-owned deployment.

Three reasons to choose Linking

  • Two clear tasks. Review Python behavior and its direct tests first, then review HTTP wiring. Existing libraries stay usable from scripts and jobs.
  • One route map. Method and pattern lead to module:function, source file and line. JSON request events carry route IDs and a source fingerprint for diagnosis.
  • A checkable contract. Static diagnostics, editor schema, typed OpenAPI and conservative contract comparison provide gates for proposed changes.

These properties help people and coding assistants find and review the relevant context. They establish no universal improvement in token use, speed or reliability. Flask blueprints and FastAPI routers/service layers can also separate business code. Choose Linking for its external manifest and inspection workflow; choose a native framework when its Python HTTP interface or broader ecosystem fits better.

Build a persistent, protected API

Opt into validation: typed to prepare Pydantic input and output adapters, nested models and their schemas. Body bindings accept RFC 6901 pointers. Omitted typed mode retains legacy conversion; legacy return schemas remain documentary.

A separate runtime.factory registers named resource providers and guards. Providers inject database connections and principals into ordinary functions; request/application contexts manage acquisition and cleanup. Guards run in order, fail closed and leave identity and owner policy to the application. Declarative response and errors supply success status/headers and safe domain-error mappings. 204/205/HEAD omit bodies; unmapped errors return a generic JSON 500.

The standalone SQLite example demonstrates nested models, transactions, owner permissions, process-restart persistence and 201/204/400/401/403/404/409 without APIZIT. Applications own their database, identity service, secrets, migrations and backups.

Locate and control a change

apizit-linking routes . --json
apizit-linking explain . --method GET --path /tasks/12 --json
apizit-linking export . --resolve-models --output before.json
# Edit the business code, then run its direct and HTTP tests.
apizit-linking validate . --json
apizit-linking export . --resolve-models --output after.json
apizit-linking diff before.json after.json --json

--resolve-models explicitly imports project code and prepares its runtime factory. Static exports do not. Diff exits 0 for compatibility, 1 for changed/removed contracts and 2 for invalid exports or unresolved typed changes. Compatible HTTP does not prove business correctness. See the diagnostic workflow.

Integration and limits

from apizit_linking.fastapi import create_app
app = create_app(".")

The ASGI factories keep documentation disabled unless docs=True. Platforms can compile with compile_linking_file, serialize CompilationResult.to_runtime_dict() and load via create_app_from_runtime_artifact. Manifest schema v1 remains stable; 1.0 artifacts use format v2 and require the exact compiling engine version. Recompile after every engine change; never vendor the engine into an adapter.

Opt-in RequestLimits bounds received body, query pairs, JSON structure and active requests. Optional asynchronous business deadlines return 504 after cleanup. Synchronous work cannot be forcibly stopped; external servers own connection, header and process limits. Models follow Pydantic configuration; unannotated output uses Any and mutable instances follow their instance-revalidation policy.

There is no portable streaming/WebSocket contract, built-in ORM, identity provider, deployment service or execution sandbox. Private import namespaces prevent module collisions. Read current limits and migration. APIZIT is a separate optional hosting platform.

Development and documentation

uv sync --locked --all-extras --all-groups
uv run python -m unittest discover -s tests -p "test_*.py"
uv run ruff check src tests
uv run black --check src tests
uv build --clear --build-constraints build-constraints.txt --require-hashes

CI checks source, real HTTP/restart/reload, minimum dependencies, core-only installation, wheel installation on Linux/Windows/macOS and identical double builds. Maintainer contracts and qualification evidence are in docs/. English public documentation is edited once in the examples repository and exported with source commit and hashes to APIZIT /linking/. GitHub Pages stays public during the protected-site transition; /docs/linking/ remains the SaaS guide.

Metadata

Release files for apizit-linking 1.0.0rc1

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

Source distribution (sdist)

Source distribution for apizit-linking 1.0.0rc1
File Size Uploaded
apizit_linking-1.0.0rc1.tar.gz 131.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apizit-linking 1.0.0rc1
File Interpreter ABI Platform
apizit_linking-1.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 200.6 kB

Release files / apizit_linking-1.0.0rc1.tar.gz

Download URL apizit_linking-1.0.0rc1.tar.gz
Size 131.1 kB
Tags Source
SHA-256 checksum
How to use checksums
27db11c7b403de447248f48d436510336bdb45a706c2c37b1823b243adacf1ba
BLAKE2b-256 checksum
How to use checksums
958e4e880913c749e0161eef6085a8a7bb8b5c5abb367ee9661e4655dec61fdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 30, 2026.

Transparency log

Release files / apizit_linking-1.0.0rc1-py3-none-any.whl

Download URL apizit_linking-1.0.0rc1-py3-none-any.whl
Size 69.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
471d8166d066c1020dde089bc85b3d4a7ad4f4d0acf306630ab981f579e65097
BLAKE2b-256 checksum
How to use checksums
0b88234aac727218ed3f94e159a99ca4b45f29de73616cf4df9bb3ab2e86559c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 30, 2026.

Transparency log
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