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.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

callback_factory-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for callback-factory-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e0239f49349b77db77ed3a629e39553aac2e3460cb28b703dd48f137062d36fc
MD5 94e6f217d3493f69f684143c69f99e2f
BLAKE2b-256 95b9b755eaf05f3317c0a87239899c4084cd65df853e7ca70853d7a75778cbb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for callback_factory-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14476be9cd04c4f680d5a5a0c19808a0936168fb644d8b521382be092d5cb34d
MD5 c49ae4da5be3351925db620fbf594693
BLAKE2b-256 f8814348cb13142d9675bc5e0f2175630763734d8de37deb2c9693729fae9d3d

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