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.4.tar.gz
(27.0 kB
view details)
Built Distribution
File details
Details for the file gemi_python-0.1.4.tar.gz
.
File metadata
- Download URL: gemi_python-0.1.4.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98d69aadca4fc77529bf3ecddbf2abbfa67c89f18f9451e2f20879d345d6683 |
|
MD5 | becc90d45add7896a601303437c6099e |
|
BLAKE2b-256 | 580c68ae72b65b8d59ec9c43e97591648ee423d4f6be6a8aedee0629f1d9ebc6 |
File details
Details for the file gemi_python-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: gemi_python-0.1.4-py3-none-any.whl
- Upload date:
- Size: 30.3 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 | a2d200404e841641972838bf583f389abc336729e95f54a9f6700475c82103f1 |
|
MD5 | 9e0a1597f6e74793c2c1ab5cd54f2758 |
|
BLAKE2b-256 | 15855dd8964db76dabb4049ebdb5e7f00091e4bf12b6e9dfd2baa762f7bc6bde |