Skip to main content

Python 3 library for building Gopher clients and servers

Project description


Documentation Status PyPI version PyPI license

Python 3 library for building Gopher clients and servers

Pituophis, at the moment, requires nine modules: os, re, sockets, asyncio, ssl, mimetypes, glob, and urllib, which are standard in most Python 3.7 installations, and natsort. Pituophis can simply be loaded as a module like this:

import pituophis


Pituophis can act as a powerful Gopher server, with full Bucktooth-style gophermap and globbing support. Scripting is also supported through alt handlers (used in the event of a 404) or fully custom handlers (replaces Pituophis' handler entirely).

The simplest method of getting a server up and running is with the pituophis.serve() function. See the examples and docs for more information. If you'd like to see a server built with Pituophis that can search an index, try Gophew.



Pituophis can also grab files and parse menus from Gopher servers. Simple fetching is done with Request().get() and get(), and Request().stream() can be used for lower-level access as a BufferedReader. The get functions return a Response type. See the docs for more information.


An interactive demo of Pituophis' client features is provided in the form of TreeGopher, a graphical Gopher client in ~200 lines of code. It uses Pituophis, PySimpleGUI, and Pyperclip. It can browse Gopher in a hierarchical structure (similarly to WSGopher32, Cyberdog, and Little Gopher Client), read text files, download and save binary files (writing in chunks using Request().stream(), and running on another thread), recognize URL: links and use search services.


Getting menus and files as plain text:

pituophis.get('gophers://').text() # gophers:// URL support

Getting a menu, parsed:

menu = pituophis.get('').menu()
for item in menu:

Using search services:


Downloading a binary:


Requests can also be created from a URL:

import pituophis
req = pituophis.parse_url('gopher://')
print('Getting', req.url())
rsp = req.get()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Pituophis, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size Pituophis-1.1-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Pituophis-1.1.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page