Skip to main content

C extension to fetch an item from a nested structure made out of dictionaries and/or lists. Can reduce the time spent retrieving items from nested structures resulted after de-serializing JSON content or other nested structures.

Project description

Ultra Path

This module is made out of a simple C extension to help reduce the total time required to extract items from highly nested structures. At the moment it supports retrieving items from nested structures made out of dictionaries and lists but it can be easily extended to support other mappings or iterables.

Usage:

>>> from upath import getp

>>> getp({"level0": {"level1": [{"level3": 3}]}}, "level0.level1.0.level3") 3

>>> getp({"level0": {"level1": [{"level3": 3}]}}, "level0/level1/0/level3", '/', None) 3

>>> getp({"level0": {"level1": [{"level3": 3}]}}, "level0/level1/0/level77777777", '/', "Default value") 'Default value'

Only positional arguments are supported, so this will not work:

>>> getp({"level0": {"level1": [{"level3": 3}]}}, "level0/level1/0/level3", default='Works') None

Check C extensions documentation here: https://docs.python.org/3/extending/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upath-1.0.1-cp37-cp37m-macosx_10_14_x86_64.whl (5.1 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

Details for the file upath-1.0.1-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: upath-1.0.1-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using 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.7.3

File hashes

Hashes for upath-1.0.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4fc0171a0f80d169819036336443219118ed881fb7756ad132a14ab73bbc0716
MD5 93e47296a89f86266784c291d392edab
BLAKE2b-256 7e67057a587b04e108e2891bd37fec3577211f1b2adfb6f7aec706ab3dc66b27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page