Skip to main content

Modern Gopher protocol server and client implementation using asyncio

Project description

Mototli

CI PyPI version codecov Python versions License Documentation

Modern Gopher protocol server and client implementation using asyncio.

Mototli brings the classic Gopher protocol (RFC 1436) into modern Python with full Gopher+ extensions (RFC 4266), async/await support, and a developer-friendly API.

Part of the small internet protocol family alongside Nauyaca (Gemini) and Mapilli.

Features

  • Async Client - Browse gopherspace with an elegant async API
  • Full Server - Host your own gopherhole with static files, CGI, and directory listings
  • Gopher+ Support - Complete RFC 4266 implementation with attributes and views
  • CLI Tools - Rich command-line interface for browsing and serving
  • TOML Config - Flexible server configuration
  • Type Safe - Full type hints with strict mypy

Installation

# Using uv (recommended)
uv add mototli

# Using pip
pip install mototli

Quick Start

Browse Gopherspace

# Fetch a directory listing
mototli get gopher.floodgap.com

# Fetch a text file
mototli text gopher.floodgap.com /gopher/welcome

# Get Gopher+ attributes
mototli attrs gopher.floodgap.com /gopher

Serve a Gopherhole

# Serve current directory
mototli serve --port 7070

# With configuration
mototli serve --config server.toml

Python Client

import asyncio
from mototli.client import GopherClient

async def main():
    async with GopherClient() as client:
        response = await client.get("gopher.floodgap.com", "/")
        for item in response.items:
            print(f"[{item.item_type.value}] {item.display_text}")

asyncio.run(main())

Python Server

import asyncio
from mototli.server import run_server

asyncio.run(run_server(document_root="./gopherhole", port=7070))

Documentation

Full documentation is available at mototli.readthedocs.io:

Development

# Clone and install
git clone https://github.com/alanbato/mototli.git
cd mototli
uv sync

# Run tests
uv run pytest

# Run linting
uv run ruff check .

# Run type checking
uv run mypy src/

# Build docs locally
uv run mkdocs serve

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

mototli-0.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

mototli-0.1.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file mototli-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for mototli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d16ea32fee7d1f315f56afa30a013b289fe5e43ccd2449aa77f2c396d8f4c71
MD5 33049047fd45be0067a4d168660bcedb
BLAKE2b-256 94a8f1a5395ead7b10319e96268d243607b1443b8b209aa6416f81158307f4dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mototli-0.1.0.tar.gz:

Publisher: publish.yml on alanbato/mototli

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

File details

Details for the file mototli-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for mototli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c78460057211cb4e49ecc79ebb157f09aef7c9d7b366fe403779cde12c75dfb8
MD5 db392b5a9bdabed338d6a57ce1e7fd80
BLAKE2b-256 fbf092536542bd8043e6f0bfd4b7b37954b16408567edbf76eea7a44b3862ec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mototli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on alanbato/mototli

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