Skip to main content

Gemlog-from-RSS

A simple RSS to Gemlog (Gemini log) converter.

The original version is developed for SPIP, but I am going to also work on a version for WordPress.

Usage (SPIP)

A working example for the SPIP version of this library can be ran using the example.py class. It also allows for a quick preview of the code without having to go into gemlog_from_rss/examples.py.

(Main) file structure - minimum working code

To run this code the following structure is required:

from gemlog_from_rss.spip import MainPage, Page
import xml.etree.ElementTree as ET
import shutil

from pathlib import Path
Path("resources").mkdir(parents=False, exist_ok=True)
main_page = MainPage(feed="https://url.to.feed")
Path(main_page.root).mkdir(parents=True, exist_ok=True)

tree = ET.parse("resources/all_posts.xml")
root = tree.getroot()
main_page.root = root

# Adding those pages is optional!
page = Page()
page.download_html("http://url.to.html.resource/file.html")
page.fetch_content()

page_2 = Page()
page_2.download_html("http://url.to.html.resource/file.html")
page_2.fetch_content()

main_page.add_page(page)
main_page.add_page(page_2)
# alternatively:
main_page.add_pages([page, page_2])

main_page.add_posts()

main_page.create_files()
with open(f"{main_page.root_dir}/index.gmi", "w") as f:
    f.write(main_page.make_main_page())

    # Remove temporary resources directory
try:
    shutil.rmtree('resources')
except OSError as e:
    print("Error: %s : %s" % ('resources', e.strerror))

Running the server

To run the Gemini server, please use Gemini server software. This package doesn't come with a Gemini server, but I recommend agate. It is super easy to install and run, and you can make this library work with it by outputting the articles and index.gmi to a directory used by agate.

Please make sure that the files outputted by gemlog_from_rss are either located in the root directory of your Gemini server or that they are linked to from your main Gemini page.

Contributing and further development

This library will be developed further. If you want to contribute to development, please fork this repository and start a pull request when you are ready to submit.

Metadata

Release files for gemlog-from-rss 0.1.0

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

Source distribution (sdist)

Source distribution for gemlog-from-rss 0.1.0
File Size Uploaded Provenance Actions
gemlog_from_rss-0.1.0.tar.gz 5.9 kB Without provenance Details for gemlog_from_rss-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gemlog-from-rss 0.1.0
File Interpreter ABI Platform Actions
gemlog_from_rss-0.1.0-py3-none-any.whl Python 3 none any Details for gemlog_from_rss-0.1.0-py3-none-any.whl

Total release size: 12.5 kB

Release files / gemlog_from_rss-0.1.0.tar.gz

Download URL gemlog_from_rss-0.1.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
953f6ea2d5b1193c2faf6c3d4314fe79bb6d3e94c6479a4b235b3d794c137218
BLAKE2b-256 checksum
How to use checksums
47f535189f81a750220a0d1e8b855fae73cbeb6b7362f505eebacd3e60faa8ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5

Release files / gemlog_from_rss-0.1.0-py3-none-any.whl

Download URL gemlog_from_rss-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf581addb1a67733ee935253f5605465fbece5c9633520ba17934d3ecd0dece8
BLAKE2b-256 checksum
How to use checksums
ba45c5b3285ac78d1db0b52688f070a785c264efe2ebe666158262ae2767b9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5

Security for gemlog-from-rss 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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