Skip to main content

pyfallback

Install

pip install fallback

Usage

from pyfallback import Fallback

json = {
    'attr-1': 'value-1',
}
json = Fallback(json, fallback="default")

# fallback
json["attr-1"].get()  # "value1"
json["attr-2"].get()  # "default"

# chaining
json["attr-1"].split('-')[0].get()  # "value"

# see tests/test_fallback.py for more example 

Contributing

Just submit a pull request :D
Note: this project uses poetry and pyenv

Metadata

Release files for pyfallback 0.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 pyfallback 0.1.0
File Size Uploaded Provenance Actions
pyfallback-0.1.0.tar.gz 6.5 kB Without provenance Details for pyfallback-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 13.2 kB

Release files / pyfallback-0.1.0.tar.gz

Download URL pyfallback-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
19172d17a43cbadd725e6e133c4bd4802ccf5132bf1becb14031b0b116765729
BLAKE2b-256 checksum
How to use checksums
ed68d2b6fdf546c86c4026f92bd6027945fb3e67aba3f805f5e9603ed92f9d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.9 Windows/10

Release files / pyfallback-0.1.0-py3-none-any.whl

Download URL pyfallback-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b83a08240f91bdbd3c4799ec2a3217579d3f0a7fa8b437ad860848e84a1c7883
BLAKE2b-256 checksum
How to use checksums
f1addcd478fdd41dae9441ec30220ecb49f68b0cdc11b04ac0ba5b076b524bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.9 Windows/10

Security for pyfallback 0.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

0.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