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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: callback-factory-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 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.2.tar.gz
Algorithm Hash digest
SHA256 4870edc3b26f3abbba7cfaa458dad13e751b7c4a1d26ab133ddfb0b961d1d304
MD5 21d76f40c817c452ac0c103902d19da1
BLAKE2b-256 6d41534710f2afcb8823cd12bef521a52268b758081e154d2e535f483023a846

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for callback_factory-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 810527c431e01814459eeac28f759c3992ddb47d35671293edca43b5ec2078c0
MD5 7096ed856b082256a3ede4c238223414
BLAKE2b-256 8ccad64d2cc9d9496ceb36c69f24931c15fc2867593284a8e674b4c03a800f3f

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