gemcall
Python module/CLI program for making network requests with the gemini protocol.
Command line usage
usage: gemcall [-h] [-c CLIENTCERT] [-k CLIENTKEY] [-u URL] [-o OUTPUTFILE]
[-t TIMEOUT] [-q] [-n] [-s]
Python module/CLI program for making network requests with the gemini
protocol.
optional arguments:
-h, --help show this help message and exit
-c CLIENTCERT, --clientcert CLIENTCERT
Path to client certificate. This is optional, but must
be used when -k/--clientkey is used.
-k CLIENTKEY, --clientkey CLIENTKEY
Path to the private key file for a client certificate.
This is optional, but must be used when
-c/--clientcert is used.
-u URL, --url URL Fully qualified URL to fetch.
-o OUTPUTFILE, --outputfile OUTPUTFILE
File to output response body to.
-t TIMEOUT, --timeout TIMEOUT
Timeout of connection attempt, in seconds. Default is
3.
-q, --quiet Don't print response header.
-n, --nobody Only print response header.
-s, --stdoutonly Print everything to stdout
Installation
pip install git+https://notabug.org/tinyrabbit/gemcall.git#egg=gemcall
# unofficial package is uploaded on PyPI for convenience
pip install gemcall
Library Usage
import gemcall
response = gemcall.request(url)
# OR
response = gemcall.request(url, clientcert, clientkey)
while True:
buf = response.read()
if len(buf) > 0:
sys.stdout.buffer.write(buf)
else:
break
response.discard()
The gemcall.Response object has the following values:
- serverpubkey: the public key part of the server certificate (the ONLY relevant part in TOFU certificate validation).
- responsecode: the response code from the server.
- meta: the rest of the header.
The method read() should be used to get content from the response object. It takes an argument 'bufsize', which is how many bytes it will read at most. This defaults to 4096.
When you are done reading the response you should use the discard() method to close all file handles and sockets the Response object is handling.
CLI Usage
gemcall [OPTIONS]
Features
- Supports client certificates.
- Supports streaming.
Todo
- Error checking >.<
- Validation of response code and meta.
Metadata
Release files for gemcall 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gemcall-0.9.2.tar.gz | 4.8 kB | Without provenance | Details for gemcall-0.9.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gemcall-0.9.2-py3-none-any.whl | Python 3 | none | any | Details for gemcall-0.9.2-py3-none-any.whl |
Total release size: 10.5 kB
Release files / gemcall-0.9.2.tar.gz
| Download URL | gemcall-0.9.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd0aba7e6b7fb73898b0c8f1addf89c44d8af7b69886773eb75d59f5a07f43e3
|
|
BLAKE2b-256 checksum How to use checksums |
76686fd631747994e3a5b0a63d8b0f10e0adb63c2d8c18228eec52ed5552b45b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / gemcall-0.9.2-py3-none-any.whl
| Download URL | gemcall-0.9.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e856dc1bf02f6aca2f3c3d75c393f8c5b461356b3477084f14f26a1bc15884a6
|
|
BLAKE2b-256 checksum How to use checksums |
875ce255a2a0caa22fa80dfed4a9cec549437b237d594c2c77a43b089d7015e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for gemcall 0.9.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.