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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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