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.0a2

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.0a2
File Size Uploaded Provenance Actions
pyspokes-0.1.0a2.tar.gz 21.8 kB Without provenance Details for pyspokes-0.1.0a2.tar.gz

Built distribution (wheel)

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

Total release size: 49.0 kB

Release files / pyspokes-0.1.0a2.tar.gz

Download URL pyspokes-0.1.0a2.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
80b35a80d3e52353bfcf7048a0a9bc8c5f25664b06972160b705a05e58df1e86
BLAKE2b-256 checksum
How to use checksums
bc1df478d339562ae1e84c3426316bb95de7272470c215811622384188400c9d
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.0a2-py3-none-any.whl

Download URL pyspokes-0.1.0a2-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7adae3ccdf705bf233d890b6ba05904b598e2fcbefd15ef54da62509771d3d73
BLAKE2b-256 checksum
How to use checksums
49751c2529baf10603089d9c9d8a285ae8c9451d16f79d2e3780420e4e4d0290
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.0a2

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