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

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

Built distribution (wheel)

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

Total release size: 51.6 kB

Release files / pyspokes-0.1.0a5.tar.gz

Download URL pyspokes-0.1.0a5.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9c4ad57176d5712aeede846dd2a199ef0490a7346f394263c76aa141927a2347
BLAKE2b-256 checksum
How to use checksums
55505e8f2040e38555b41ae0ea006a3d43cc3b55247c3c25faf8c9db5c39c1dd
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.0a5-py3-none-any.whl

Download URL pyspokes-0.1.0a5-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5adbea720ffe47e472119a6108b1b7de847daedb068a07394729f8f730d0dc8e
BLAKE2b-256 checksum
How to use checksums
25aca61411439c7a72908ffe2a01fafbeb70a91fc1a07b25d73476d0d6ee5532
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.0a5

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