min-rss-gen
A minimal RSS 2.0 generator. Follows guidelines from https://validator.w3.org/feed/docs/rss2.html
XML Implementations
Accepts any implementation that fulfills Python's ElementTree API. Due to this, lxml is supported.
Installation
pip install min-rss
Usage
The following script powers the RSS feed at https://nwalsh1995.github.io/rss.xml
from min_rss_gen.generator import start_rss, gen_item
import xml.etree.ElementTree
from glob import glob
from pathlib import PurePath
SITE = "https://nwalsh1995.github.io"
RSS_FILENAME = "rss.xml"
rss_items = []
# Generate all items
for f in glob("**/*.html", recursive=True):
path = PurePath(f)
title = path.with_suffix("").name.replace("-", " ").title()
rss_items.append(gen_item(title=title, link=f"{SITE}/{str(path)}"))
# Generate the <rss> XML element and subelements.
rss_xml_element = start_rss(title="nwalsh1995.github.io", link="nwalsh1995.github.io", description="A collection of thoughts.", items=rss_items)
# You can add custom subelements onto the returned <rss> element if you choose.
with open(RSS_FILENAME, "wb") as f:
f.write(xml.etree.ElementTree.tostring(rss_xml_element))
Metadata
Release files for min-rss 0.0.3
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 |
|---|---|---|---|---|
| min-rss-0.0.3.tar.gz | 4.1 kB | Without provenance | Details for min-rss-0.0.3.tar.gz |
Release files / min-rss-0.0.3.tar.gz
| Download URL | min-rss-0.0.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2df8a8f6d3a1b64c4134af303e7b9283f87403a053fc9b8da0b66c80f28624d8
|
|
BLAKE2b-256 checksum How to use checksums |
91452da2762cd12abd1b69f92416a186cc256d7919a42d08fdae7d9a02ebbbf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0
|
Security for min-rss 0.0.3
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.