Skip to main content

A simple function to generate a simple filtered dict where a dict is created based on a dictionary and a function. The returned dict contains all the kwargs if the passed function which are present in the inut dict.
This is espacially useful if you have a dict with more keys than needed to call a function or you call a function by reference and want to pass an dict as kwargs

Example:

d = dict(a=0,b=1,s1="foo",s2="bar") 
def merge_strings(s1="",s2=""):
    return s1+s2

print(merge_strings(**d))
#throws TypeError: merge_strings() got an unexpected keyword argument 'a'

print(merge_strings(**filter_dict(d,merge_strings)))
# returns foobar as expected

Metadata

Release files for FilterDict 0.2.1553767117

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

Source distribution (sdist)

Source distribution for FilterDict 0.2.1553767117
File Size Uploaded Provenance Actions
FilterDict-0.2.1553767117.tar.gz 2.2 kB Without provenance Details for FilterDict-0.2.1553767117.tar.gz

Built distribution (wheel)

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

Total release size: 17.1 kB

Release files / FilterDict-0.2.1553767117.tar.gz

Download URL FilterDict-0.2.1553767117.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4e7dd4340103e93b9a6ffa58d19fa660abc0f96f08c5a92ec7eb390816dba845
BLAKE2b-256 checksum
How to use checksums
b2cd274097afe9ec9cb7b146ab857b1b993a27211b374878396590763f54c6db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / FilterDict-0.2.1553767117-py3-none-any.whl

Download URL FilterDict-0.2.1553767117-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94f3adb5a91b816d0696f3f6566b941d2dde0c431f6b258b7e8577a4b08bf2fd
BLAKE2b-256 checksum
How to use checksums
9f66984aba6566659978a57cf3d07f46c61e20aa57eaa702672fd4fc23c7a9dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Security for FilterDict 0.2.1553767117

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