Skip to main content

funksignal · GitHub license

funksignal is a synchronous signaling library for event-driven programming. Bind methods to signals which will be executed once the signal is emitted.

How to Install

To install funksignal, open a terminal and use the pip package manager:

   pip install funksignal

Instructions

To use funksignal effectively, bind one or more methods to a signal identified by a unique key. When the signal is emitted, all methods bound to that signal will be executed. If you no longer need the binding, you can simply unbind it.

from funksignal import Signal

def example():
    print("Hello World")

Signal.bind("signal-key", example)
Signal.emit("signal-key")
Signal.unbind("signal-key", example)

funksignal provides an interface to pass arguments – from within bind(), emit() or simultaniously via *args and **kwargs.

from funksignal import Signal

def example(a, b):
    print(f"{a} {b}")

Signal.bind("1a", example)
Signal.emit("1a", "Hello", "World")

Signal.bind("1b", example, "Hello", "World")
Signal.emit("1b")

Signal.bind("2a", example)
Signal.emit("2a", a="Hello", b="World")

Signal.bind("2b", example, a="Hello", b="World")
Signal.emit("2b")

Signal.bind("2c", example, a="Hello")
Signal.emit("2c", b="World")

Documentation

Auto-generated documentation using pydoc-markdown.

bind

@classmethod
def bind(cls, key: Union[str, int], callable: callable, *args: any, **kwargs: any) -> None

Binds a callable to a signal. The callable will be executed when the signal is emitted.

unbind

@classmethod
def unbind(cls, key: Union[str, int], callable: callable) -> None

Unbinds a callable from a signal. After unbinding, the callable will no longer be executed when the signal is emitted.

emit

@classmethod
def emit(cls, key: Union[str, int], *args: any, **kwargs: any) -> None

Emits a signal identified by the given key. This triggers the execution of all callables that are bound to the signal. You can pass arguments to the bound methods via *args and **kwargs.

Metadata

Release files for funksignal 0.1.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 funksignal 0.1.0
File Size Uploaded Provenance Actions
funksignal-0.1.0.tar.gz 15.2 kB With provenance Details for funksignal-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.8 kB

Release files / funksignal-0.1.0.tar.gz

Download URL funksignal-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c6ca0eee3dc635a768e5753841ab0ed345d412ec929e27382c168956d62cca62
BLAKE2b-256 checksum
How to use checksums
8931f35bc704ef343a33be7c2cba76a96090d9227d81f09921a1e68535cd4f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 23, 2025.

Transparency log

Release files / funksignal-0.1.0-py3-none-any.whl

Download URL funksignal-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a63bfc82c32f036e44a35ad47d71fdfc15ae8c7494f9fd0b0bd9d7746d40ff61
BLAKE2b-256 checksum
How to use checksums
ee71bbd17a51f01b1064f107451b0983560ae3501a72aacea2ae0fa2595ebbf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 23, 2025.

Transparency log

Security for funksignal 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for funksignal-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 23, 2025.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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