Skip to main content

OuterSpace Apizr

Apizr is an open-source capability compiler for Python codebases.

Discover capabilities in existing Python code, assess their static readiness, explicitly choose what to expose, generate REST or MCP interfaces, and run them under direct or governed execution policies.

Latest published stable: 0.2.1 · Release candidate in this repository: 0.3.0

0.3 adds explicit Exposure Plans and multi-module repository REST/MCP bundles, with direct, fresh local-process or fresh OCI-container execution. Discovery, generation, direct execution and local execution need no Docker. Python 3.11–3.14 · GPL-3.0-or-later.

PyPI version CI Security Documentation Python License

Install stable or try the candidate

Published stable:

python -m pip install outerspace-apizr==0.2.1

The walkthrough below requires the unpublished 0.3.0 repository candidate:

git clone https://github.com/Alien6-Studio/outerspace-apizr.git
cd outerspace-apizr
python -m pip install .
apizr --version

Use a virtual environment. 0.3.0 is not yet on PyPI; a final package version in the repository does not mean a release has been published.

The base candidate installs only Pydantic for static Python workflows. Optional workflows require explicit extras (this changes the default installation from 0.2.1):

Workflow Checkout installation
Notebook inspection/generation python -m pip install ".[notebook]"
HTTP adapters python -m pip install ".[http]"
MCP adapters python -m pip install ".[mcp]"
Complete historical pipeline/web app python -m pip install ".[legacy]"

Extras combine, for example ".[notebook,mcp]". Install a 0.3 wheel with [legacy] to retain the full 0.2.1 stack. Generated servers keep their own requirements.

One repository, two public capabilities

Create these three files in an empty directory (also available in the repository's examples/repository-shop):

pricing.py

def total(unit_price: float, quantity: int = 1) -> float:
    return unit_price * quantity

inventory.py

def available(stock: int, requested: int = 1) -> bool:
    return stock >= requested

api.py

def quote(unit_price: float, quantity: int = 1) -> float:
    return _price(unit_price, quantity)


def _price(unit_price: float, quantity: int) -> float:
    from pricing import total

    return total(unit_price, quantity)

Save readiness-direct.json:

{"execution":{"modes":["direct"]}}

Save exposure-direct.json:

{"selection":{"include":["python:api:quote","python:inventory:available"]},"interfaces":["rest","mcp"],"execution":{"allowed":["direct"]}}

Discover, understand, assess, explicitly select, then expose:

apizr scan . --exclude-dir .output
apizr graph . --exclude-dir .output
apizr readiness . --exclude-dir .output --policy readiness-direct.json
apizr expose plan . --exclude-dir .output --readiness-policy readiness-direct.json --policy exposure-direct.json
apizr expose build rest . --exclude-dir .output --readiness-policy readiness-direct.json --policy exposure-direct.json --output-dir .output/rest
apizr expose build mcp . --exclude-dir .output --readiness-policy readiness-direct.json --policy exposure-direct.json --output-dir .output/mcp

The explicit .output exclusion keeps generated files outside the scan universe. Readiness reports three ready functions and one conditional support helper, so its exit code is 1. The two explicitly selected public functions are eligible; planning and building succeed. READY does not mean exposed. pricing.total is packaged and called through api._price, but neither helper is public.

Serve the direct REST bundle:

python -m pip install -r .output/rest/requirements.txt
uvicorn app:app --app-dir .output/rest --host 127.0.0.1 --port 8000

POST {"unit_price":12.5,"quantity":2} to /capabilities/api.quote25.0. POST {"stock":10,"requested":3} to /capabilities/inventory.availabletrue. The MCP bundle exposes the same two names. Install its requirements.txt, then run python .output/mcp/server.py --transport stdio or use --transport streamable-http. These generated servers execute trusted code. Use a fresh output directory when regenerating. Discovery and generation do not execute project source.

Choose execution boundaries

Mode Boundary State between calls
Direct Transport process Persists
Governed local-process Fresh process per call Resets
Governed OCI Fresh container per call Resets

Add --execution-policy for governed execution. Local workers provide time and input/output bounds, environment control and process-group cleanup; they do not isolate host filesystem or network access. OCI adds reviewed Linux container controls using an immutable image ID/platform and the repository worker protocol. It is not a VM or an untrusted-code guarantee. The optional strict OCI subprocess-deny profile blocks process and thread creation before project import. Local mode cannot enforce it.

See the policy examples and exposure guide for local/OCI commands, policy composition and image prerequisites. Apizr does not infer/install repository application dependencies or package arbitrary repository data files. The separate legacy pipeline supports explicit requirements and resources.

Eligibility, selection and interfaces

Readiness is evidence-based eligibility. Exposure Plan is the operator's explicit decision. Bundle is the generated public interface. Dependencies are packaged as support, never automatically exposed. All stages bind deterministic evidence; neither READY nor a generated bundle establishes trust or runtime safety.

Start here · Architecture · 0.3 candidate notes and migration

Existing workflows and limits

0.2 single-source inspect, generate rest/mcp and execute workflows remain supported, as does the legacy apizr --script / --notebook pipeline. There is no automatic migration or publication. Capabilities remain top-level functions; class/method exposure and an enterprise control plane are outside this release.

The legacy pipeline now supports configured notebook cell selection, resource packaging, explicit image builds and installed plugins. It inventories classes and methods separately, and refuses ambiguous selected definitions/overloads. See the notebook configuration guide. Static readiness/exposure v1 adapters retain their original control vocabulary; the strict OCI profile is selected in the execution policy. See compatibility notes.

Development and checks · Report an issue · GPL-3.0-or-later

Release files for outerspace-apizr 0.3.0

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

Source distribution (sdist)

Source distribution for outerspace-apizr 0.3.0
File Size Uploaded
outerspace_apizr-0.3.0.tar.gz 161.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for outerspace-apizr 0.3.0
File Interpreter ABI Platform
outerspace_apizr-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 412.8 kB

Release files / outerspace_apizr-0.3.0.tar.gz

Download URL outerspace_apizr-0.3.0.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
83e21ecbe1eed3d30f7b8315b3b331afe00bd4e98ca6a836b28bb4f11c45d9d5
BLAKE2b-256 checksum
How to use checksums
28fecec202d2ad9af2d8591670a7090bef2c027cfb548b05270d682e5f0c066d
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 22, 2026.

Transparency log

Release files / outerspace_apizr-0.3.0-py3-none-any.whl

Download URL outerspace_apizr-0.3.0-py3-none-any.whl
Size 251.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b806a406e0fb886a39cd900c4116f13ed836af9a38fd3a3baf45b941c5f1b187
BLAKE2b-256 checksum
How to use checksums
15ab9ca0db70f681d92362e030f6a02a4ce8cdc5152ffd8ac1d56c57c3e6ffba
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 22, 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