Skip to main content

Callouts

A minimalist dispatch system for python module lose coupling.

Imagine we had an application that checks weather for one place, but using multiple service. The functionality to get weather for a specific service could be implemented in individual modules.

To implement this with callouts, we first need to implement the extensibility base by creating a class with the @callouts.base decorator.

@callouts.base
class Weather:
    def get_for(location: str) -> str: 
        pass 

Now, individual implementations can be added simply by extending the class and implementing the get_for method.

class FirstWeatherService(Weather):
    def get_for(location: str) -> str: 
        return 'sunny' 
class SecondWeatherService(Weather):
    def get_for(location: str) -> str: 
        return 'cloudy'

with those definition in place, as soon as the modes are loaded it is possible to get both weathers by calling the get_for method on the Weather class:

print(Weather.get_for('place'))

will print out

['sunny', 'cloudy']

Metadata

Release files for callouts 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for callouts 0.2.0
File Interpreter ABI Platform Actions
callouts-0.2.0-py3.10.egg Legacy Egg format - - Details for callouts-0.2.0-py3.10.egg

Release files / callouts-0.2.0-py3.10.egg

Download URL callouts-0.2.0-py3.10.egg
Size 4.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
330176470e6cf58f90a9320815903af55b1a9115d5dfcf9d48fcd1b01dac1e1d
BLAKE2b-256 checksum
How to use checksums
4bb26c3eb7baa6ec7f0ac187ed1bf621e5ee6f4f2efa06e0ffc6030ea0b90285
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Security for callouts 0.2.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.

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