Skip to main content

A simple Python library for producing parameterized and flexible callbacks that can be overriden during execution

Project description

callback

Callback factory in Python, providing two similar approaches to produce parameterized and flexible callbacks that can be overriden during execution.

Installation

pip install callback-factory

Example

from callback import CallbackFactory

def greet(name, greeting="Hello"):
    return f"{greeting}, {name}!"

callback = CallbackFactory(greet, "Alice", greeting="Hi")

print(callback())  # Output: Hi, Alice!

One can find more usage examples in examples.py at the root folder of this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

callback-factory-0.0.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

callback_factory-0.0.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file callback-factory-0.0.3.tar.gz.

File metadata

  • Download URL: callback-factory-0.0.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for callback-factory-0.0.3.tar.gz
Algorithm Hash digest
SHA256 85a5b7647a8218c551aedc3eb1f89ef1adce44bc07397b426664dd8a72db06fb
MD5 b2c8004d7581d75ec1ee70a61325724b
BLAKE2b-256 19417d8c5f2040c914987ed2ff3f52eadb265cd9d60957cec7b9edb097247d5b

See more details on using hashes here.

File details

Details for the file callback_factory-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for callback_factory-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1acd0d5235ff6b5050f6e5abe14b9094293a7366fa5c9d7fa1fa0d1d0d9f775b
MD5 e0465ada72057b907f4fee2d53d67057
BLAKE2b-256 f3751b2a6af668f7eecaaf984a1438a8839a5eac26f6761c7e8863f566699c03

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page