Skip to main content

Library for parsing JSON lines.

Project description

prop · py

Pypi Version Build Status Code coverage 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 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.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

prop-0.0.2-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: prop-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 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.2.tar.gz
Algorithm Hash digest
SHA256 5066b39a0e041f0b5da507dd90add1b1414cf7191f5625badd876eb56d76e5cf
MD5 17dc4143d052f6987007154d0f3cd4d7
BLAKE2b-256 a014f12ead67e2308804b77bdb2c6fde03c196ec5eca544599711c9bae7ca83b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prop-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.9 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b5cd79daf5bd7393203fe3b01ee57cb43c785c390d1e8ac893fb0ebfa76e3244
MD5 5c074805c9516a30544e03c6422cbd0f
BLAKE2b-256 d15a2d2f4432a8d20c07c28f40717029512c15a346481e397d06e7082e0cbf0c

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