Skip to main content

Modern Spartan protocol server and client implementation using asyncio

Project description

Teyaotlani

Modern Spartan protocol server and client implementation using asyncio

Documentation License: MIT Python 3.10+

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teyaotlani-0.1.4.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

teyaotlani-0.1.4-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file teyaotlani-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for teyaotlani-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b4a626a770a0c93b956e12080919525e5a4c490d92a6a9ec5b5648b7612f7591
MD5 4a4c03b06e6dc0aa0810a4f7e9023a16
BLAKE2b-256 aa8f039b973c78b09b039ac44064ab5c00c9cdf285712fa49182d3b70a4ae582

See more details on using hashes here.

Provenance

The following attestation bundles were made for teyaotlani-0.1.4.tar.gz:

Publisher: release-pypi.yml on alanbato/teyaotlani

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

File details

Details for the file teyaotlani-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for teyaotlani-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 834153a972d566e025fbeb1d8994af410853b0c5452b56ef85a673c538959fc9
MD5 e7aa9030ae1de508f5135dabaa3d1479
BLAKE2b-256 71a2e5cf66515be86326afd543f7165f405620dba19ecf7f779bce3bb7e36a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for teyaotlani-0.1.4-py3-none-any.whl:

Publisher: release-pypi.yml on alanbato/teyaotlani

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