From plain Python to local HTTP
Fork or clone a complete project, validate it without importing the business module, then start the local preview.
Prerequisite: Python 3.10 or newer. The example pins apizit-linking[preview,models]==1.0.1 for repeatable behavior.
1. Get the project#
Fork the public repository to experiment in your own GitHub account, or clone it directly:
Terminal
git clone https://github.com/chipsi44/apizit-linking-examples.git
cd apizit-linking-examples
python -m venv .venvActivate the virtual environment#
Windows PowerShell
.venv\Scripts\Activate.ps1macOS or Linux
source .venv/bin/activate2. Install the local preview#
The repository dependency installs the standalone binding engine, FastAPI adapter, multipart support, and Uvicorn development server:
Terminal
python -m pip install -r requirements.txtFor validation without preview, the smaller core installation is sufficient:
Core only
python -m pip install "apizit-linking==1.0.1"3. Inspect the complete project#
The runnable root project has one business file and one HTTP contract.
hello.py
def hello() -> dict[str, str]:
return {"message": "Hello from APIZIT Linking!"}apizit_linking.yaml
version: 1
runtime:
language: python
version: "3.12"
routes:
- path: /hello
method: GET
function: hello:helloThe Python module has no APIZIT Linking or web-framework import. The function value names the module and top-level function as module:function.
4. Validate without executing business code#
Terminal
apizit-linking validate .A successful result reports that the definition is valid and compiled one route.
Expected output
APIZIT linking definition is valid: .../apizit_linking.yaml
Compiled routes: 1Validation parses the Python source with the AST. It checks the route, function, signature, parameter bindings, and collisions without importing or calling hello.py.
5. Preview and call the route#
Terminal 1
apizit-linking preview . --port 8080Keep that process running. From another terminal:
Terminal 2
curl http://127.0.0.1:8080/helloResponse · 200 OK
{"message":"Hello from APIZIT Linking!"}Stop the preview with Ctrl+C.
Local development only. Preview binds to 127.0.0.1 by default. It is not a production server, authentication layer, or sandbox. Starting it imports and executes trusted customer code in the server process.