ignition-gemini

Gemini Protocol Client for Python Developers

https://github.com/cbrews/ignition

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

client gemini gemini-protocol libraries library python python3
Last synced: 6 months ago · JSON representation

Repository

Gemini Protocol Client for Python Developers

Basic Info
  • Host: GitHub
  • Owner: cbrews
  • License: mpl-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 484 KB
Statistics
  • Stars: 35
  • Watchers: 1
  • Forks: 5
  • Open Issues: 3
  • Releases: 14
Archived
Topics
client gemini gemini-protocol libraries library python python3
Created over 5 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

Ignition: Python3 Gemini Protocol Client Transport Library

This is Gemini Control.  We're at T-1 minute, T-60 seconds and counting.  T-45 seconds and counting.  The range holding a final status check.  T-30 seconds.  Recorders have gone to fast speed.  Twenty seconds.  Fifteen seconds.  Ten, nine, eight, seven, six, five, four, three, two, one zero.  Ignition.

Ignition is a simple but powerful transport library for Python3 clients using the recently designed Gemini protocol. This project intends to implement all of the transport specifications (sections 1-4) of the Gemini protocol and provide an easy-to-use interface, so as to act as a building block in a larger application.

If you're building a Python3 application that uses Gemini, Ignition is your gateway to the stars, in very much the same way that requests is for HTTP and gopherlib is for Gopher.

In order to provide a best-in-class interface, this library does not implement the other parts of a typical client (including user interface and/or command line interface), and instead focuses on providing a robust programmatic API interface. This project also assumes that different user interfaces will have different requirements for their display of text/gemini files (.gmi), and/or other mime-types, and as such considers this portion of the specification beyond the scope of this project.

In addition, in order to provide stability and simplicity, minimal third-party dependencies are required for Ignition.

Project Status

GitHub release (latest by date) CI v2 PyPI - Python Version PyPI - License

The status is good to go.  This is Gemini Control.

Ignition is no longer being updated.

Installation

⚠ Ignition supports Python versions 3.7 - 3.12.

Ignition can be installed via PIP. You should install it in alignment with your current development process; if you do not have a build process yet, I recommend you install within a virtual environment

bash pip install ignition-gemini

If you prefer to install from source, you can clone and install the repository:

bash git clone https://github.com/cbrews/ignition.git cd ignition pip install .

Simple Usage

The most basic usage of Ignition allows the user to create a request and get a response back from a remote Gemini capsule: ```python import ignition

Fetch capsule content

response = ignition.request('//geminiprotocol.net')

Get status from remote capsule

print(response.status)

Get response information from remote capsule

print(response.data()) ``` source

In all cases, Ignition assumes that the specified endpoint and protocol will respond over the Gemini protocol, so even if you provide a different protocol or port, it will assume that the endpoint is a Gemini capsule.

Key Features

This is Gemini Control.  The conversation between pilot and ground so far in this filght has largely been confined to the normal type of test pilot talk that you would expect.

✅ Ignition supports the following features: * Basic request/response connectivity to a Gemini-enabled server. * Basic URL parsing mechanics to allow for specifying protocol, host, port, path, and query params, as per RFC-3986 * Optional referer URL handling. Ignition allows the user to pass a path & referer URL and can construct the new path, to simplifying the resolution of links on a Gemini capsule page. * Basic decoding of body responses on successful (20) response from Gemini servers. * Trust-on-first-use certificate verification handling scheme using key signatures. * Fully-featured response objects for each response type. * Standardized & robust, human-readable error management. * Custom error handling for networking failure cases beyond the scope of the protocol.

❌ The following Gemini features will not be supported by Ignition: * Behavioral processing/handling of specific response types from Gemini capsules, including: * Generation of client certificates & automatic resubmission. * Automatic redirection following on 3x responses. * Advanced body response rendering and/or display of text/gemini mime types. * Command line or GUI interface. * Advanced session & history management. * Support for other protocols. * Non-verified certificate scheme * Improved TOFU scenarios

Advanced Usage

More advanced request usage:

```python import ignition

response = ignition.request('/software', referer='//geminiprotocol.net:1965')

print("Got back response %s from %s" % (response.status, response.url))

Got back a response 20 from gemini://geminiprotocol.net/software

if not response.success(): print("There was an error on the response.") else: print(response.data()) ```

Passing a referer: ```python import ignition

response1 = ignition.request('//geminiprotocol.net') response2 = ignition.request('software', referer=response1.url)

print(response2) ``` source

More advanced response validation: ```python import ignition

url = '//geminiprotocol.net' response = ignition.request(url)

if response.is_a(ignition.SuccessResponse): print('Success!') print(response.data())

elif response.is_a(ignition.InputResponse): print('Needs additional input: %s' % (response.data()))

elif response.is_a(ignition.RedirectResponse): print('Received response, redirect to: %s' % (response.data()))

elif response.is_a(ignition.TempFailureResponse): print('Error from server: %s' % (response.data()))

elif response.is_a(ignition.PermFailureResponse): print('Error from server: %s' % (response.data()))

elif response.is_a(ignition.ClientCertRequiredResponse): print('Client certificate required. %s' % (response.data()))

elif response.is_a(ignition.ErrorResponse): print('There was an error on the request: %s' % (response.data())) ``` source

Finally, the module exposes DEBUG level logging via standard python capabilities. If you are having trouble with the requests, enable debug-level logging with:

python import logging logging.basicConfig(level=logging.DEBUG)

API Documentation

Full API documentation for Ignition is available here.

Developers

There are a few reports from the pilots.  They are simply identifying their flight plan very carefully.  Four minutes into the flight, Gordon Cooper just told Grissom that he is looking mighty good.  Gus gave him a reasuring laugh.  A very calm pilot in command of that spacecraft.

Ignition is no longer accepting contributions. Please feel free to fork this repository.

License

Ignition is licensed under Mozilla Public License 2.0.

Copyright 2020-2024 by Chris Brousseau.

Thank you

  • solderpunk for leading the design of the Gemini protocol, without which this project would not have been possible.
  • Sean Conman for writing the Gemini torture tests, which were instrumental in initial client testing.
  • Michael Lazar for his work on Jetforce, which helped testing along the way.

🔭 Happy exploring!

Owner

  • Name: Chris Brousseau
  • Login: cbrews
  • Kind: user
  • Location: Boston, MA
  • Company: @indigo-ag

Software Engineer, Architect @indigo-ag in Boston, MA

GitHub Events

Total
  • Watch event: 1
  • Fork event: 5
Last Year
  • Watch event: 1
  • Fork event: 5

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 157
  • Total Committers: 7
  • Avg Commits per committer: 22.429
  • Development Distribution Score (DDS): 0.478
Top Committers
Name Email Commits
dependabot[bot] 4****]@u****m 82
Chris Brousseau c****s@u****m 55
Chris Brousseau c****u@i****m 11
Chris Brousseau c****s@c****z 4
Chris Brousseau cb@c****z 3
Christopher Brousseau c****u@o****m 1
Ben Evans b****n@b****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 188
  • Average time to close issues: about 1 year
  • Average time to close pull requests: about 13 hours
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.43
  • Average comments per pull request: 0.05
  • Merged pull requests: 180
  • Bot issues: 0
  • Bot pull requests: 168
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: about 5 hours
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • cbrews (7)
Pull Request Authors
  • dependabot[bot] (198)
  • cbrews (22)
Top Labels
Issue Labels
enhancement (3) good first issue (2) bug (1) question (1)
Pull Request Labels
dependencies (197)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 752 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 19
  • Total maintainers: 1
pypi.org: ignition-gemini

ignition - Gemini Protocol Client Transport Library

  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 752 Last month
Rankings
Dependent packages count: 9.7%
Stargazers count: 11.4%
Average: 16.4%
Forks count: 19.2%
Downloads: 20.0%
Dependent repos count: 21.9%
Maintainers (1)
Last synced: about 1 year ago

Dependencies

.github/workflows/ci-v2.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/python-publish-package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • cryptography >=36.0.0