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.1.tar.gz (36.6 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.1-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mototli-0.1.1.tar.gz
  • Upload date:
  • Size: 36.6 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.1.tar.gz
Algorithm Hash digest
SHA256 e1c41d6793520ad0c7a387542bb2a92a7f2696561f8515ff4dfa2104b76322f4
MD5 26ad2b180d6b558f6771e4aa4f1aeb02
BLAKE2b-256 a05ecb07611cae463ad785c5a4bf43fb455a4f384468e9f46d7739fb4684e3e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mototli-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: mototli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 49.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad3ad7b577a0278324a80c64de2141815fefee460ffe9863117017728b76cf8c
MD5 deeb5bd603b212e4c13dec8401ed5ad3
BLAKE2b-256 764b4be272839864fced62a5bed21e76c72575e319e6bfed16e1e54129488b1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mototli-0.1.1-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