Modern Gopher protocol server and client implementation using asyncio
Project description
Mototli
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d16ea32fee7d1f315f56afa30a013b289fe5e43ccd2449aa77f2c396d8f4c71
|
|
| MD5 |
33049047fd45be0067a4d168660bcedb
|
|
| BLAKE2b-256 |
94a8f1a5395ead7b10319e96268d243607b1443b8b209aa6416f81158307f4dc
|
Provenance
The following attestation bundles were made for mototli-0.1.0.tar.gz:
Publisher:
publish.yml on alanbato/mototli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mototli-0.1.0.tar.gz -
Subject digest:
4d16ea32fee7d1f315f56afa30a013b289fe5e43ccd2449aa77f2c396d8f4c71 - Sigstore transparency entry: 786936151
- Sigstore integration time:
-
Permalink:
alanbato/mototli@ab1770aa0fc1492182e4defc2ee2615cd788cc08 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ab1770aa0fc1492182e4defc2ee2615cd788cc08 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c78460057211cb4e49ecc79ebb157f09aef7c9d7b366fe403779cde12c75dfb8
|
|
| MD5 |
db392b5a9bdabed338d6a57ce1e7fd80
|
|
| BLAKE2b-256 |
fbf092536542bd8043e6f0bfd4b7b37954b16408567edbf76eea7a44b3862ec8
|
Provenance
The following attestation bundles were made for mototli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on alanbato/mototli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mototli-0.1.0-py3-none-any.whl -
Subject digest:
c78460057211cb4e49ecc79ebb157f09aef7c9d7b366fe403779cde12c75dfb8 - Sigstore transparency entry: 786936160
- Sigstore integration time:
-
Permalink:
alanbato/mototli@ab1770aa0fc1492182e4defc2ee2615cd788cc08 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alanbato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ab1770aa0fc1492182e4defc2ee2615cd788cc08 -
Trigger Event:
release
-
Statement type: