Metadata-Version: 2.3
Name: teyaotlani
Version: 0.1.3
Summary: Modern Spartan protocol server and client implementation using asyncio
Keywords: spartan,protocol,server,client,asyncio,networking
Author: Alan Velasco
Author-email: Alan Velasco <alanvelasco.a@gmail.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: AsyncIO
Requires-Dist: rich>=14.2.0
Requires-Dist: structlog>=25.5.0
Requires-Dist: tomli>=2.0.0 ; python_full_version < '3.11'
Requires-Dist: typer>=0.20.0
Requires-Python: >=3.10
Project-URL: Repository, https://github.com/alanbato/teyaotlani
Description-Content-Type: text/markdown

# Teyaotlani

**Modern Spartan protocol server and client implementation using asyncio**

[![Documentation](https://readthedocs.org/projects/teyaotlani/badge/?version=latest)](https://teyaotlani.readthedocs.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

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

```bash
# Using uv (recommended)
uv add teyaotlani

# Using pip
pip install teyaotlani
```

## Quick Start

### Client

```python
import asyncio
from teyaotlani import get

async def main():
    response = await get("spartan://example.com/")
    print(response.body)

asyncio.run(main())
```

### Server

```python
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

```bash
# 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](https://teyaotlani.readthedocs.io/).

- [Installation](https://teyaotlani.readthedocs.io/tutorials/installation/)
- [Quick Start](https://teyaotlani.readthedocs.io/tutorials/quick-start/)
- [API Reference](https://teyaotlani.readthedocs.io/reference/api/)

## 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](https://teyaotlani.readthedocs.io/explanation/spartan-protocol/).

## License

MIT License - see [LICENSE](LICENSE) for details.
