Modern Spartan protocol server and client implementation using asyncio
Project description
Teyaotlani
Modern Spartan protocol server and client implementation using asyncio
Teyaotlani (from Nahuatl: "warrior") is a Python library for building Spartan protocol servers and clients. It provides an async-first design with a clean, intuitive API.
Features
- Async-first design - Built on asyncio for high-performance concurrent connections
- Full protocol support - Complete Spartan client and server implementation
- CLI included - Command-line tools for fetching, uploading, and serving content
- Configurable server - Rate limiting, access control, and upload handling
- Type-safe - Full type annotations for modern Python development
Installation
# Using uv (recommended)
uv add teyaotlani
# Using pip
pip install teyaotlani
Quick Start
Client
import asyncio
from teyaotlani import get
async def main():
response = await get("spartan://example.com/")
print(response.body)
asyncio.run(main())
Server
import asyncio
from teyaotlani import ServerConfig, run_server
async def main():
config = ServerConfig(
host="localhost",
port=3000,
document_root="./capsule",
)
await run_server(config)
asyncio.run(main())
CLI
# Fetch a page
teyaotlani get spartan://example.com/
# Serve files
teyaotlani serve ./capsule --port 3000
# Upload content
teyaotlani upload spartan://localhost:3000/file.txt -c "Hello!"
Documentation
Full documentation is available at teyaotlani.readthedocs.io.
What is Spartan?
Spartan is a simple, text-focused internet protocol similar to Gemini but without TLS complexity. It's designed for:
- Lightweight content serving
- Native file uploads
- Easy implementation
- Internal networks and learning
Learn more in the Spartan Protocol explanation.
License
MIT License - see LICENSE for details.
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 teyaotlani-0.1.2.tar.gz.
File metadata
- Download URL: teyaotlani-0.1.2.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcd1b96f8765570375c8d46d5051f5c3cd84d66cda208e935d8853556ea2f987
|
|
| MD5 |
6babbb33fa96cf3a8969a22226475346
|
|
| BLAKE2b-256 |
27669ed77a291c6bec486a0d54fde8cfc477225e89e697133f73d319799176e9
|
Provenance
The following attestation bundles were made for teyaotlani-0.1.2.tar.gz:
Publisher:
release-pypi.yml on alanbato/teyaotlani
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teyaotlani-0.1.2.tar.gz -
Subject digest:
dcd1b96f8765570375c8d46d5051f5c3cd84d66cda208e935d8853556ea2f987 - Sigstore transparency entry: 803234815
- Sigstore integration time:
-
Permalink:
alanbato/teyaotlani@09d8cc38a157b72d0271063a031a229c0a990db1 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@09d8cc38a157b72d0271063a031a229c0a990db1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file teyaotlani-0.1.2-py3-none-any.whl.
File metadata
- Download URL: teyaotlani-0.1.2-py3-none-any.whl
- Upload date:
- Size: 33.3 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 |
dd35135daf72e46331ec5eb6702a0683185da3a2e1b303b718c07d5a4f22143e
|
|
| MD5 |
789083bd1e48358fed72b99d5f2618bc
|
|
| BLAKE2b-256 |
3791093d6a5fb80318cc3fecbf1f94b4c8ee5627cf06998ab82e03a8c625b967
|
Provenance
The following attestation bundles were made for teyaotlani-0.1.2-py3-none-any.whl:
Publisher:
release-pypi.yml on alanbato/teyaotlani
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teyaotlani-0.1.2-py3-none-any.whl -
Subject digest:
dd35135daf72e46331ec5eb6702a0683185da3a2e1b303b718c07d5a4f22143e - Sigstore transparency entry: 803234877
- Sigstore integration time:
-
Permalink:
alanbato/teyaotlani@09d8cc38a157b72d0271063a031a229c0a990db1 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@09d8cc38a157b72d0271063a031a229c0a990db1 -
Trigger Event:
push
-
Statement type: