Skip to main content

Easier traversing and exploration of JSON structures

Project description

ez-json-traverse Build Status

For easier traversing and exploration of JSON structures.

Provides a traversable sequence EZJL, traversable mapping EZJD and convenience methods like as_traversable.

Starting off

$ pip install ez-json-traverse

followed by

from ezjt import as_traversable

Dict stuff

d = {
    'a': {'name': 'Jane', 'age': {'unit': 'year', 'value': 12}},
    'b': {'name': 'John', 'age': {'unit': 'year', 'value': 14}},
    'c': {'name': 'Jill', 'age': {'unit': 'year', 'value': 10}}
}

t = as_traversable(d, sep='.', map_char='^')  # EZJD

# Normal key access
t['a']  # EZJD of {'name': 'Jane', 'age': {'unit': 'year', 'value': 12}}

# Path key access
t['a.name']  # 'Jane'

# Mapping across values
t['^.age.value']  # EZJD of [12, 14, 10]

List stuff

l = [[0, [1, 2]], [1, [2, 3]], [2, [3, 4]]]

t = as_traversable(l, sep='.', map_char='^')  # EZJL

# Normal key access
t[0]  # EZJL of [0, [1, 2]]
t['0']  # EZJL of [0, [1, 2]]

# Path key access
t['0.1.0']  # 1

# Mapping across values
t[':^.1.0']  # EZJL of [1, 2, 3]
t['1:-1^.1.0']  # EZJL of [2] 

Other conveniences

l = [[0, [1, 2]], [1, [2, 3]], [2, [3, 4]]]

t = as_traversable(l, sep='.', map_char='^')  # EZJL

# Normal key access
t[0]  # EZJL of [0, [1, 2]]
t['0']  # EZJL of [0, [1, 2]]

# Path key access
t['0.1.0']  # 1

# Mapping across values
t[':^.1.0']  # EZJL of [1, 2, 3]
t['1:-1^.1.0']  # EZJL of [2] 

Project details


Download files

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

Source Distribution

ez-json-traverse-0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

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

ez_json_traverse-0.1-py3.7.egg (4.5 kB view details)

Uploaded Egg

ez_json_traverse-0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ez-json-traverse-0.1.tar.gz.

File metadata

  • Download URL: ez-json-traverse-0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ez-json-traverse-0.1.tar.gz
Algorithm Hash digest
SHA256 40abd077302ab0ec55104f81a81a560883e5f4094494eaca401de01b52ec65dd
MD5 f37acfcd0b91d23f1aafc95498217e40
BLAKE2b-256 e2a52bdd10787b6144f4590c09190fa13c35af106c189c5dde02f9b5c71055ee

See more details on using hashes here.

File details

Details for the file ez_json_traverse-0.1-py3.7.egg.

File metadata

  • Download URL: ez_json_traverse-0.1-py3.7.egg
  • Upload date:
  • Size: 4.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ez_json_traverse-0.1-py3.7.egg
Algorithm Hash digest
SHA256 06b2e4fb054be992416cad5d00c753912899c0fa783b79fb6cb06ad4effdb70e
MD5 1c0c65324792b1b22fc89d14be578e27
BLAKE2b-256 c303272ad649c7dcc24af8defaa1b0dd293e3863c5c19e5df57ddc5de094884e

See more details on using hashes here.

File details

Details for the file ez_json_traverse-0.1-py3-none-any.whl.

File metadata

  • Download URL: ez_json_traverse-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ez_json_traverse-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81f74247308024bc3432e5a82ca2f15d1254f5e3d03228fdc50d180138926a2b
MD5 1ef9518cdd2e708a590379966e0c6049
BLAKE2b-256 48e7d90799bf8a83ca833e38e93db0be963ce37d4e3e3d58923e1fa0a30a8249

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