Skip to main content

Chocolate

Chocolate is a Python package that improves Python's **kwargs.

from chocolate import filter_args


# Here is some function.
def example_function(arg1, arg2: int, arg3=3, arg4: str = ""):
    print(f"{arg1} {arg2} {arg3} {arg4}")

# We can give this function a dictionary of arguments using **kwargs.
kwargs = {"arg1": 1, "arg2": 2, "arg4": "4"}
example_function(**kwargs)

# But what if the **kwargs dictionary has additional keys?
broken_kwargs = {"arg1": "This", "arg2": "does", "undefined_arg": "not", "arg3": "work"}
try:
    example_function(**broken_kwargs)
except Exception as exception:
    print(exception)

# Chocolate can take care of that!
example_function(**filter_args(broken_kwargs, example_function))

Metadata

Release files for chocolate 0.0.2

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

Source distribution (sdist)

Source distribution for chocolate 0.0.2
File Size Uploaded Provenance
chocolate-0.0.2.tar.gz 1.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for chocolate 0.0.2
File Interpreter ABI Platform
chocolate-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 3.7 kB

Release files / chocolate-0.0.2.tar.gz

Download URL chocolate-0.0.2.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3474af447e11c592635afae2578d8f425351045949dc1c2fd3a98dd859b5816c
BLAKE2b-256 checksum
How to use checksums
346afb1e15a5335e53024a0b021cca740a5ae7b68f78586c20bed5b0938218fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / chocolate-0.0.2-py3-none-any.whl

Download URL chocolate-0.0.2-py3-none-any.whl
Size 2.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
071ea6177492d80c903eb6c7c30638a2d97d9561ace40b7b5c3f2b220c3a246e
BLAKE2b-256 checksum
How to use checksums
ecdf206fea3fbad2b8c709f9bad919515aa7658b631dd95e7de49978343d7007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Security for chocolate 0.0.2

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

0.0.2 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