Skip to main content

pyresolve

Resolve dot notation from dictionary

from pyresolve import resolve

my_dictionary = {"out":{"middle":{"in":"Balue"}}}

# Before
my_dictionary.get('out', {}).get('middle', {}).get('in')

# After
resolve(my_dictionary, "out.middle.in") # "Balue"

Does not break for missing properties

resolve(my_dictionary, "outer.missing.something") # None

Can specify a different default value

resolve(my_dictionary, "outer.missing.something", []) # []

Supports index in list

dictionary_with_list = {"users": [{"name":"Joe"}, {"name":"Jane"}]}
resolve(my_dictionary, "users.1.name") # Jane

Install

pip install pyresolve

Metadata

Release files for pyresolve 1.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 pyresolve 1.1.0
File Size Uploaded
pyresolve-1.1.0.tar.gz 1.8 kB Details

Built distribution (wheel)

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

Total release size: 4.8 kB

Release files / pyresolve-1.1.0.tar.gz

Download URL pyresolve-1.1.0.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5482400bbe7a8ba4bf5e2b0ec480a7bc69d68cf41a02f58452c20a8a02f49af6
BLAKE2b-256 checksum
How to use checksums
94cb774c41b436aa0fc0afe7f596b7b7b34af9a83c308d4eb33e7165d1e81579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.7.4

Release files / pyresolve-1.1.0-py3-none-any.whl

Download URL pyresolve-1.1.0-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5567469ca99ad54b4075952e5e7dd21d9d8abf92bdf6e8c0d1407a9c2f0198d8
BLAKE2b-256 checksum
How to use checksums
7be732bc295306194793bf0346118ff01a220140b8af47b5327721ef1cdf96cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.0

2 release files

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