Skip to main content

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_certificate and 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

  1. Create app.py:
from xitzin import Xitzin, Request

app = Xitzin()

@app.gemini("/")
def home(request: Request):
    return "# Hello, Geminispace!"

if __name__ == "__main__":
    app.run()
  1. Generate TLS certificates:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
  1. Run your capsule:
python app.py
  1. Visit gemini://localhost/ with a Gemini client like Astronomo.

Documentation

Full documentation is available at xitzin.readthedocs.io.

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

xitzin-0.1.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

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

xitzin-0.1.2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file xitzin-0.1.2.tar.gz.

File metadata

  • Download URL: xitzin-0.1.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xitzin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f7986d0858c21a442fb09fc8c6c9066ee72b331b289047fa26a17d85e82cf775
MD5 ef54cb343ae8139b2054ab7cc3a1d70e
BLAKE2b-256 2ccbf8e1fe8fb04beda6d391d3f9cdcfd4c3568f0b4627e6ceccd2c50d5ad46d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xitzin-0.1.2.tar.gz:

Publisher: release-pypi.yml on alanbato/xitzin

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

File details

Details for the file xitzin-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xitzin-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xitzin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5db9f9bd67667b85672c9b7cebf6e5c74c75d51e7425625432c08abbc2873d65
MD5 02f38848237ee9ba01d192c16606f24a
BLAKE2b-256 0a4447698cf2e7af8a230007e1d3aa1b94a912a82a18f3f3d4e78f7935bc12d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for xitzin-0.1.2-py3-none-any.whl:

Publisher: release-pypi.yml on alanbato/xitzin

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