Library for parsing JSON lines.
Project description
prop · py
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
- https://github.com/chrisinajar/py-dot-prop - (Python) Get a property from a dict or list
- https://github.com/sindresorhus/dot-prop - (Node.js) Get, set, or delete a property from a nested object using a dot path
- https://github.com/jonschlinkert/get-value - (Node.js) Use property paths (
a.b.c
) to get a nested value from an object
License
MIT © Cristi Constantin.
Project details
Release history Release notifications | RSS feed
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)