Utilities for the Gemini protocol
Project description
Gemi
Utilities for the Gemini protocol
Client Example
import asyncio
import gemi
async def main():
client = gemi.AsyncClient()
response = await client.request("geminiprotocol.net")
for element in (await response.document()):
print(repr(element))
asyncio.run(main())
Server Example
import gemi
@gemi.route("Default", "/")
async def home(request: gemi.Request) -> gemi.Response:
return gemi.Response(20, "UvU", "text/plain")
server = gemi.AsyncServer("Default")
server.run()
Document Example
import gemi
doc = gemi.Document([
gemi.Header("Hewwo!", 1),
gemi.Text(""),
gemi.Text("im gay"),
gemi.Text(""),
gemi.Link("https://git.barkshark.xyz/barkshark/gemi", "Gemi")
])
doc.dump("/var/lib/gemi-server/static/text.gmi", gemi.OutputFormat.GEMTEXT)
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
gemi_python-0.1.3.tar.gz
(26.4 kB
view details)
Built Distribution
File details
Details for the file gemi_python-0.1.3.tar.gz
.
File metadata
- Download URL: gemi_python-0.1.3.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 284b00e7560d90d6ad56a87a64791459211e3fad022a5889f767748e9df652b8 |
|
MD5 | 33ac13f030dbf8880d546758ffaa9c14 |
|
BLAKE2b-256 | 6737d5b8df076b184f52f9df782d19c21fb4727181b6cda12d656f489ee14d09 |
File details
Details for the file gemi_python-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: gemi_python-0.1.3-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04c68c54e3493616806787de6a736f4aa6f82928cf10e0e3466f85a96d2ce5c6 |
|
MD5 | d5bbf1c79160cd7ab3dfb9da42fb095e |
|
BLAKE2b-256 | 96d74f54d887d2ca672940693db4821dcb526fe42240dc56921fcea3c344eaab |