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.2.tar.gz (24.3 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.2-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

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

Hashes for teyaotlani-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dcd1b96f8765570375c8d46d5051f5c3cd84d66cda208e935d8853556ea2f987
MD5 6babbb33fa96cf3a8969a22226475346
BLAKE2b-256 27669ed77a291c6bec486a0d54fde8cfc477225e89e697133f73d319799176e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for teyaotlani-0.1.2.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.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

Hashes for teyaotlani-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd35135daf72e46331ec5eb6702a0683185da3a2e1b303b718c07d5a4f22143e
MD5 789083bd1e48358fed72b99d5f2618bc
BLAKE2b-256 3791093d6a5fb80318cc3fecbf1f94b4c8ee5627cf06998ab82e03a8c625b967

See more details on using hashes here.

Provenance

The following attestation bundles were made for teyaotlani-0.1.2-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