Skip to main content

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)

Documentation

Gemini Protocol

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.2.tar.gz (26.0 kB view hashes)

Uploaded Source

Built Distribution

gemi_python-0.1.2-py3-none-any.whl (29.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page