finger2gemtext - A simple library for converting finger output to Gemtext
Introduction
finger2gemtext is a small and simple library that provides code for
converting finger responses into the hypertext markup language of the
Gemini project.
Installation
finger2gemtext is available from
pypi and can be installed with your
package installer of choice.
With pip:
pip install finger2gemtext
With uv:
uv add finger2gemtext
Quick start
The library provides a single main conversion function called
finger_to_gemtext. It is passed a string that is the finger response you
wish to convert, and the result is a string that is the resulting Gemtext.
A very minimal converter might look like:
import fileinput
from .convert import finger_to_gemtext
def convert() -> None:
"""Parse the input from stdin or files and print the parsed Gemtext."""
with fileinput.input() as finger_content:
print(finger_to_gemtext("".join(finger_content)))
While it is primarily intended as a library to be used from other Python
code, it does contain a simple test command line tool, which can be accessed
either via the Python -m switch, or depending on your environment, via the
finger2gemtext command. For example, if you were to run this command:
finger @typed-hole.org | finger2gemtext
you'd get output like this:
[typed-hole.org]
Welcome to the Typed Hole
Uptime: 14:10:28 up 248 days, 22:12, 0 user, load average: 0.44, 0.34, 0.44
Users currently logged in: probably julien
Available fingers:
=> /finger/username username: get user infos
=> /finger/feed feed: get my latest toots
=> /finger/lobsters lobsters: get lobste.rs hottest stories
=> /finger/weather weather: get typed-hole.org current weather
=> /finger/temp temp: get typed-hole.org current CPU temperature
=> /finger/cyoa cyoa: finger your own adventure
=> /finger/textfile textfile: read a random textfile from textfiles.com
=> /finger/smog smog: read SMOG e-zine issues
See the main documentation for the full API.
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 finger2gemtext-0.0.1.tar.gz.
File metadata
- Download URL: finger2gemtext-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbe635ecb55c11914fd25c4659943d0a517a71cde5d4abff05afd22183553243
|
|
| MD5 |
7668090d5c55a0d72139c9ddc85e32e6
|
|
| BLAKE2b-256 |
39719565b3d701bb7f384e533939eed0517bc6c2fe29afd7fbdadab9c1768f74
|
File details
Details for the file finger2gemtext-0.0.1-py3-none-any.whl.
File metadata
- Download URL: finger2gemtext-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a2a261a896fb1ad495dea65d8394588ed3c6c4e27c6ce3c0c6da3b359bc505
|
|
| MD5 |
0adb0a878d1505ef8f4d3f4578f084fe
|
|
| BLAKE2b-256 |
74e47c12e86a396a1e283c512997cb79fa57d0c0482aa1be532e26029571d881
|