Skip to main content

utils-py

Continuous Integration version-badge

A set of python utilities.

Usage

poetry add outcome-utils

Cache

To add cache to a module

from outcome.utils import cache

cache_settings = {
    '<your_prefix>.expiration': 300,  # Default
    '<your_prefix>.backend': 'memory',  # Default
}

region = cache.get_cache_region()
cache.configure_cache_region(region, settings=cache_settings, prefix='<your_prefix>')

Then add to the functions to cache:

@region.cache_on_arguments()
def func_to_cache():
    ...

Or for async functions:

@region.cache_on_arguments()
@cache.cache_async
async def async_func_to_cache():
    ...

To have the cache persist on disk, specify the path

from pathlib import Path

cache_settings = {
    ...
    '<your_prefix>.cache_path': f'{Path.home()}/.cache/example_path/cache.pkl'',
    ...
}

Development

Remember to run ./pre-commit.sh when you clone the repository.

Metadata

Release files for outcome-utils 5.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 outcome-utils 5.1.0
File Size Uploaded Provenance Actions
outcome-utils-5.1.0.tar.gz 16.5 kB Without provenance Details for outcome-utils-5.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for outcome-utils 5.1.0
File Interpreter ABI Platform Actions
outcome_utils-5.1.0-py3-none-any.whl Python 3 none any Details for outcome_utils-5.1.0-py3-none-any.whl

Total release size: 37.0 kB

Release files / outcome-utils-5.1.0.tar.gz

Download URL outcome-utils-5.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1068a0d11f36da664b3d403810ec1b2349e5217868d4a4045307c1b4639e6445
BLAKE2b-256 checksum
How to use checksums
d37271ce42deee0f6477451029d3d4f2a3f8b0aa86560eccd1c577e1f6e4304d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.6 Linux/5.4.0-1046-azure

Release files / outcome_utils-5.1.0-py3-none-any.whl

Download URL outcome_utils-5.1.0-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7223d3239db8fe41c27c7b94c598c677b75c38076a6dc79be5f3db5ae9103963
BLAKE2b-256 checksum
How to use checksums
4dd4c5a3706f026d2ac48dc314369335e98a36eb1d4111947e14856adeb05792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.6 Linux/5.4.0-1046-azure

Security for outcome-utils 5.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.

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.

Release history Release notifications | RSS feed

This release

5.1.0 This release

2 release files No 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