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

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

Built distribution (wheel)

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

Total release size: 52.9 kB

Release files / pyspokes-0.1.0a6.tar.gz

Download URL pyspokes-0.1.0a6.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4fbb88d84c2b6238c4f39e38e2eb7f589c79be9855c5d89427652e62a32f7d4a
BLAKE2b-256 checksum
How to use checksums
13e97f56975de1b81e3bddf0f57d75e2a6d110b6217727d8c72b80118d50f42b
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.0a6-py3-none-any.whl

Download URL pyspokes-0.1.0a6-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cf3fae31803482dc91ad80cbed4314fbe2cc84852d06038a4d9e0991353dbf7
BLAKE2b-256 checksum
How to use checksums
0e594d716d9258e98e03e3b7d2233173cdf21feab2c0540c08d48596003739ac
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.0a6

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