Python indieweb-utils Library
indieweb-utils provides building blocks for people implementing IndieWeb applications in Python. Discover IndieWeb endpoints, find feeds on a page, infer page names, generate reply contexts, and more!
The documentation for this project is available at indieweb-utils.readthedocs.io.
Installation 💻
To get started, pip install indieweb-utils:
pip install indieweb-utils
Quickstart ⚡
Here are a few quick code snippets for actions enabled by IndieWeb Utils.
get reply context about a URL
import indieweb_utils
context = indieweb_utils.get_reply_context(
url="https://jamesg.blog",
summary_word_limit=50
)
print(context.name) # "Home | James' Coffee Blog"
Remove tracking parameters from a URL
import indieweb_utils
url = "https://jamesg.blog/indieweb/?utm_source=twitter&utm_medium=social&utm_campaign=webmention"
url_without_tracking = indieweb_utils.remove_tracking_params(url)
print(url_without_tracking) # https://jamesg.blog/indieweb/
Create a paginator for a series
import indieweb_utils
pages = indieweb_utils.Paginator(["post1", "post2", ...], 1)
print(pages.next_page()) [["post1"]]
License 👩⚖️
The code in this project is licensed under the Zero-Clause BSD License.
The documentation in this project is licensed under a CC BY-SA 4.0 license.
Running Tests 🧪
Quality is maintained ensuring each merged passes testing, typing, linting, and formatting requirements.
To check locally install the development dependencies and run the suite using [tox]{.title-ref}.
$ pip install -r requirements_dev.txt
$ tox
Alternatively, you can run just a single check by passing the environment to tox.
Unit Tests
Tests use pytest.
$ tox -e py39 # Run all tests
$ tox -e py39 tests/test_indieweb_utils.py::TestPostTypeDiscovery # Run a single test
Linting
Linting is checked with black, isort, and flake8.
$ tox -e lint
Black and isort errors can be fixed automatically. Use fmt to fix those errors automatically.
$ tox -e fmt
Typing
Types are validated with mypy.
$ tox -e typecheck
Contributing 🛠️
This project welcomes contributions from anyone who wants to improve the library.
Please see the contributing guidelines for more information on how to contribute to the repository.
Contributors 💻
Metadata
Release files for indieweb-utils 0.10.1
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 |
|---|---|---|---|---|
| indieweb_utils-0.10.1.tar.gz | 39.3 kB | Without provenance | Details for indieweb_utils-0.10.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| indieweb_utils-0.10.1-py3-none-any.whl | Python 3 | none | any | Details for indieweb_utils-0.10.1-py3-none-any.whl |
Total release size: 92.5 kB
Release files / indieweb_utils-0.10.1.tar.gz
| Download URL | indieweb_utils-0.10.1.tar.gz |
|---|---|
| Size | 39.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2720e882bb9e46745f67de8d8e15dbd7a949bc76212a0fdf9bdb7f5269245829
|
|
BLAKE2b-256 checksum How to use checksums |
58a52e8c35c04ea6bb968cee64d964542e1a9e9c0f2d2845233121c83cfe6995
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0b2
|
Release files / indieweb_utils-0.10.1-py3-none-any.whl
| Download URL | indieweb_utils-0.10.1-py3-none-any.whl |
|---|---|
| Size | 53.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23f274ce3b9de5883cbb2b3e1b4823aee131abfd894cee24f99a00aba0f94238
|
|
BLAKE2b-256 checksum How to use checksums |
82cabd5cbffa328fc61eecd71118f343af5a08b5a14e5867f65dde35dd1eaeb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0b2
|
Security for indieweb-utils 0.10.1
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.