Skip to main content

Library for parsing JSON lines.

Project description

prop · py

Build Status Python ver

A Python 🐍 library for getting a property from a nested object using a dot path.

Usage

import prop

data = {
    'k1': 'v1',
    'nested': {'x': 'y', 'int': 0, 'null': None},
    'list': [[None, True, 9]]
}

prop.get(data, 'k1')
# v1

prop.get(data, 'nested.x')
# x

prop.get(data, 'list.0.1')
# True

prop.get(data, 'list.0.-1')
# 9

Limitations: For navigating dicts, only string keys are supported.

Installation

$ pip install git+https://github.com/croqaz/prop

Similar libraries

License

MIT © Cristi Constantin.

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

prop-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

prop-0.0.1-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file prop-0.0.1.tar.gz.

File metadata

  • Download URL: prop-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.23.4 CPython/3.6.9

File hashes

Hashes for prop-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d87a13cc0c2465fdbc3c948442fde92a0cfa5bee0998bc5f8c86eed07747c1a5
MD5 c01cf4d258eb7047b8d82cbde924d3ee
BLAKE2b-256 bcb0e72548cb915fb56768424cc7b221ffb3ecbe7f9b27dd011346d7291ecf83

See more details on using hashes here.

File details

Details for the file prop-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: prop-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.23.4 CPython/3.6.9

File hashes

Hashes for prop-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1a0bb5bbe35444a9030eaeb699fbfb396265fb653566c4b734ad11f37ce66a32
MD5 b9945ee2b413f6af93f00d9237790759
BLAKE2b-256 d8bfebb85be3055bb73b4edd51d8e8e769dd0ef642642d53c15674e16b3f4432

See more details on using hashes here.

Supported by

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