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.3.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

gemi_python-0.1.3-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

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

Hashes for gemi_python-0.1.3.tar.gz
Algorithm Hash digest
SHA256 284b00e7560d90d6ad56a87a64791459211e3fad022a5889f767748e9df652b8
MD5 33ac13f030dbf8880d546758ffaa9c14
BLAKE2b-256 6737d5b8df076b184f52f9df782d19c21fb4727181b6cda12d656f489ee14d09

See more details on using hashes here.

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

Hashes for gemi_python-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04c68c54e3493616806787de6a736f4aa6f82928cf10e0e3466f85a96d2ce5c6
MD5 d5bbf1c79160cd7ab3dfb9da42fb095e
BLAKE2b-256 96d74f54d887d2ca672940693db4821dcb526fe42240dc56921fcea3c344eaab

See more details on using hashes here.

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