Skip to main content

pygurt

pygurt: GURT for python!

Say hello to pygurt, a Python implementation of the GURT standard, including both a client and server!

The pygurt client

pygurt comes with both a client and a server, this allows you to easily make more complex projects such as proxies!

Getting started with the client

To get started with the client, import Client from pygurt, and configure an instance of it!

Here is an example, supporting TLS and automatically fetching the GurtCA root certificate:

from pygurt import Client

client = Client(
    baseUrl='gurt://135.125.163.131:4878',
    timeout=10.0,
    useTLS=True,
    requireHandshake=True,
    maxConnections=5
)
client.loadCaFromGurtca() # Automatically fetch and load the GurtCA root certificate from http://135.125.163.131:8876/ca/root

print(client.post( # Print out the DNS looup information for `gurt://arson.dev`
    "/resolve-full",
    json="{'domain':'arson.dev'}"
).json())

The pygurt server

The pygurt server is a bit more complex, mainly because you need TLS certificates issed by GurtCA to be able to accept connections. But in reality, this is quite easy as Gurted has a tool for this exact purpose!

Getting started with the server

  1. Download and install GurtCA, you can use community builds or build from the source in the Gurted GitHub repository.
  2. Run curtca request <your domain>, and wait for it to prompt you to add a TXT record.
  3. Sign into dns.web on Flumi, and select your domain's dashboard.
  4. Add a TXT record with the name _gurtca-challenge, and the value gurtCA is telling you.
  5. Press enter on GurtCA, if verification passes then you should be left with a certs directory containing a .crt and .key file.
  6. Set up your server code, like this following example:
from pygurt import Server

server = Server(requireHandshake=True) # Must be true to be able to be connected to by clients, unless they are a pygurt client with handshakes disabled (which is very rare)!

server.tls("", "") # Pass your `.crt` file path, then your `.key` file path, both as strings.

@server.route("/", methods=["GET"])
def root_page(request, response):
    return response.status(200).text(request.text) # Sends back any body text it recieves

server.bind("0.0.0.0").start() # Defaults to `0.0.0.0` on port 4878

Tada! You have a working pygurt webserver that echoes data back to clients, and uses TLS!

Notes

Further documentation about exactly what everything is for (and does), as well as info about more advanced features is available in docstrings! Your linter should display them to you!

Legal

pygurt (C) 2025 ItsThatOneJack

The pygurt project is not affiliated — nor endorsed by — Outpoot, and its related person(s) in any way. No attempt is made by the proliferation of pygurt to claim association or affiliation with Outpoot.

The pygurt project is licensed under the GNU Affero General Public License version 3.0, you should have received a copy of the license along with pygurt. If not, see https://www.gnu.org/licenses/.

pygurt is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

pygurt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

Metadata

Release files for pygurt 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygurt 1.0.2
File Size Uploaded
pygurt-1.0.2.tar.gz 30.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygurt 1.0.2
File Interpreter ABI Platform
pygurt-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 63.8 kB

Release files / pygurt-1.0.2.tar.gz

Download URL pygurt-1.0.2.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
386c23377a6aed1e6d65f62261c4b9caefcb284929dc7c467752e803d3f8a836
BLAKE2b-256 checksum
How to use checksums
e79316c42659dd3de3b8e6dd75c82e84d65466563d8b6be528318e6a56bb5cc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.24

Release files / pygurt-1.0.2-py3-none-any.whl

Download URL pygurt-1.0.2-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
019f55df6326b390a4726bd1c4e8b03ad23b677215a957f950e044681bd5a459
BLAKE2b-256 checksum
How to use checksums
1ecd9732939ff88f27a314e4a9d63bccde575053fb4be441cacecc51cdb3f4ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.24

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page