Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Tests Coverage

pyspokes

pyspokes is a plugin system built around one idea: your application is the hub, and every implementation it can plug in is a spoke. Packages declare their spokes in a spokes.yaml file, and the application asks the hub for the interface it needs.

See the full documentation at https://ai-helpers.github.io/pyspokes

Table of Contents (ToC)

Usage

A package declares its spokes in a spokes.yaml file at its root:

# notify_app/spokes.yaml
- path: channels.EmailNotifier
  name: email

- path: channels.SlackNotifier
  name: slack
  priority: 5
# notify_app/channels.py
from notify_app.notifier import Notifier


class EmailNotifier(Notifier):
    def send(self, recipient: str, message: str) -> str:
        return f"email to {recipient}: {message}"


class SlackNotifier(Notifier):
    def send(self, recipient: str, message: str) -> str:
        return f"slack DM to {recipient}: {message}"

Once the package is installed, the application asks the hub for the interface and never imports an implementation:

from notify_app.notifier import Notifier
from pyspokes import get_spoke, get_spokes

notifier = get_spoke(Notifier)                 # highest priority: SlackNotifier
print(notifier.send("ada", "build finished"))  # slack DM to ada: build finished

email = get_spoke(Notifier, name="email")      # pick one by name
channels = get_spokes(Notifier)                # all of them, highest priority first

Adding a channel means installing a package that ships a spokes.yaml; the code above does not change. The quickstart walks through the whole example.

Getting Started

Prerequisites

  • Python 3.13+
  • uv

Install dependencies

uv sync --all-groups

Common tasks

Day-to-day commands are exposed as make tasks (run make help to list them all):

make check-tests     # run the unit tests with pytest
make checkers        # run all the checkers (lock, format, quality, types, coverage)
make formatters      # format the sources and tests with ruff
make badges          # regenerate the test and coverage badges shown above
make documenters     # build the documentation

Build the documentation

The documentation is built with Sphinx and the furo theme, and is deployed to GitHub Pages on every push to main.

make documenters

Contributing

Contributions are welcome! See CONTRIBUTING.md for the development setup, the checks to run before pushing, and the coding conventions.

Metadata

Release files for pyspokes 0.1.0a4

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

Source distribution (sdist)

Source distribution for pyspokes 0.1.0a4
File Size Uploaded Provenance Actions
pyspokes-0.1.0a4.tar.gz 23.0 kB Without provenance Details for pyspokes-0.1.0a4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyspokes 0.1.0a4
File Interpreter ABI Platform Actions
pyspokes-0.1.0a4-py3-none-any.whl Python 3 none any Details for pyspokes-0.1.0a4-py3-none-any.whl

Total release size: 51.6 kB

Release files / pyspokes-0.1.0a4.tar.gz

Download URL pyspokes-0.1.0a4.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0b6fccd3efd1bcfa96f41855ef167ff922384006a42b053cc7a846e25e39ac50
BLAKE2b-256 checksum
How to use checksums
2c2e25cb67eb8b91782621855172d2b92f253cf948e2f61b89e697f723a7165f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyspokes-0.1.0a4-py3-none-any.whl

Download URL pyspokes-0.1.0a4-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afc7fc4121dc9f8296d3da660e136f90d8ee4b9e101294dce9b25c15bef071dd
BLAKE2b-256 checksum
How to use checksums
8a1d1cf1b3c2abfb1c6d677cbcb78d9fff96ce01d45c4954bc56e9dc8da827fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pyspokes 0.1.0a4

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.

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