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.3.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.3-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: teyaotlani-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4bf6f708fcbe9676ae9cc50805fbb3abe76c29d3c1bf500bf3b8184d77fdba9c
MD5 9c7f2794294008e71fdc97c30ca013a1
BLAKE2b-256 0482499b8727f1084bf75d1da9e2bef6b4777b9a1edb584031ffa8b6ffab2e50

See more details on using hashes here.

Provenance

The following attestation bundles were made for teyaotlani-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: teyaotlani-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 529a46fb76f482ee62eec897c48b6f690f01032d6003fe70b8335898785fa3be
MD5 759e87e656257b3292580271dc8f33c7
BLAKE2b-256 ea5ffd64556a1ec029689bdb6c8ae20dcf9b3aace0dd725d15036fb5374bda04

See more details on using hashes here.

Provenance

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