Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Python indieweb-utils Library

Documentation Status image image image image

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.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 indieweb-utils 0.10.0
File Size Uploaded
indieweb_utils-0.10.0.tar.gz 38.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indieweb-utils 0.10.0
File Interpreter ABI Platform
indieweb_utils-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.5 kB

Release files / indieweb_utils-0.10.0.tar.gz

Download URL indieweb_utils-0.10.0.tar.gz
Size 38.9 kB
Tags Source
SHA-256 checksum
How to use checksums
50bc93431b4a8e5568ca50edf40f301c574286422d8bae458ba8b33277bea37c
BLAKE2b-256 checksum
How to use checksums
dd3aac0f2e70bad633975ddb9a8deb58e70aacc685bd69d96fa8adc8379572bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / indieweb_utils-0.10.0-py3-none-any.whl

Download URL indieweb_utils-0.10.0-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574a00fc40de940147459edf9ddc8e9972f7b699dff854941a157177ad6816b0
BLAKE2b-256 checksum
How to use checksums
e4f12aabec2d21e1fc6ddb7144499c75fe7fb8e41aedbc0ac6e034eb9d3879c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4
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