A Gemini Application Framework
Project description
Xitzin
Application Framework for the Geminispace
Xitzin brings a modern Python developer experience to the Gemini protocol. Build Gemini capsules with familiar patterns: decorators for routing and type-annotated path parameters.
from xitzin import Xitzin, Request
app = Xitzin()
@app.gemini("/")
def home(request: Request):
return "# Welcome to my capsule!"
@app.gemini("/user/{username}")
def profile(request: Request, username: str):
return f"# {username}'s Profile"
@app.input("/search", prompt="Enter query:")
def search(request: Request, query: str):
return f"# Results for: {query}"
if __name__ == "__main__":
app.run()
Features
- Decorator-based routing with
@app.gemini()and automatic path parameter extraction - User input handling via
@app.input()for Gemini's status 10/11 prompts - Certificate authentication with
@require_certificateand fingerprint whitelisting - Jinja2 templates with Gemtext-aware filters (links, headings, lists)
- Middleware support for logging, rate limiting, and custom processing
- Testing utilities with in-memory
TestClient - Async support for both sync and async handlers
Installation
pip install xitzin
Or with uv:
uv add xitzin
Quick Start
- Create
app.py:
from xitzin import Xitzin, Request
app = Xitzin()
@app.gemini("/")
def home(request: Request):
return "# Hello, Geminispace!"
if __name__ == "__main__":
app.run()
- Generate TLS certificates:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
- Run your capsule:
python app.py
- Visit
gemini://localhost/with a Gemini client like Astronomo.
Documentation
Full documentation is available at xitzin.readthedocs.io.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xitzin-0.8.0.tar.gz.
File metadata
- Download URL: xitzin-0.8.0.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2617dab7062420761494e4410616abb556f3c42a43124b68effaef7681790888
|
|
| MD5 |
29f3d5da1b11ace1232723e0f67d06d5
|
|
| BLAKE2b-256 |
9934ceadb562ba0cebe2fee8ecb1f3b0febb33d8faec3e7af4377c3395c13ab2
|
Provenance
The following attestation bundles were made for xitzin-0.8.0.tar.gz:
Publisher:
release-pypi.yml on alanbato/xitzin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xitzin-0.8.0.tar.gz -
Subject digest:
2617dab7062420761494e4410616abb556f3c42a43124b68effaef7681790888 - Sigstore transparency entry: 973563754
- Sigstore integration time:
-
Permalink:
alanbato/xitzin@606c1c375c366a2a72d166e634d9426472439946 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@606c1c375c366a2a72d166e634d9426472439946 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xitzin-0.8.0-py3-none-any.whl.
File metadata
- Download URL: xitzin-0.8.0-py3-none-any.whl
- Upload date:
- Size: 47.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b739f6f2956919c1973e52cb166a1297f4ab6d8fefba932005d0a81f43bb980e
|
|
| MD5 |
46aaa990dbbd20539a058a181cad8de9
|
|
| BLAKE2b-256 |
86a1f95cc945636143c77eaa23089ff0d5b41688dfb10af05f8efce93012d9c9
|
Provenance
The following attestation bundles were made for xitzin-0.8.0-py3-none-any.whl:
Publisher:
release-pypi.yml on alanbato/xitzin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xitzin-0.8.0-py3-none-any.whl -
Subject digest:
b739f6f2956919c1973e52cb166a1297f4ab6d8fefba932005d0a81f43bb980e - Sigstore transparency entry: 973563794
- Sigstore integration time:
-
Permalink:
alanbato/xitzin@606c1c375c366a2a72d166e634d9426472439946 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@606c1c375c366a2a72d166e634d9426472439946 -
Trigger Event:
push
-
Statement type: