Overview
Implements Google Partial Response / json-mask in Python.
Requirements
- Python 2.7
- Python 3.6+
Installation
Install jsonmask with pip:
$ pip install jsonmask
or directly from the source code:
$ git clone https://github.com/zapier/jsonmask.git
$ cd jsonmask
$ python setup.py install
Usage
After installation, the package can imported:
$ python
>>> import jsonmask
>>> jsonmask.__version__
To prune dictionaries:
>>> import jsonmask
>>> mask = jsonmask.parse_fields('a,b(c,d)')
>>> jsonmask.apply_json_mask(
{
'a': {
'nested_within_a': True,
},
'b' {
'c': True,
'd': {'Will get included?': 'Yes'},
'e': 'Tough luck here',
},
'c': 'Definitely hopeless',
},
mask,
)
{
'a': {
'nested_within_a': True,
},
'b' {
'c': True,
'd': {'Will get included?': 'Yes'},
},
}
Metadata
Release files for jsonmask 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jsonmask-0.1.1.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jsonmask-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / jsonmask-0.1.1.tar.gz
| Download URL | jsonmask-0.1.1.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de73eeea74e1eed12ded1fe1dca729119d7640a4cb69b8e1e255da5e7cb6d268
|
|
BLAKE2b-256 checksum How to use checksums |
a523d8a16e6c8e6cbbd78a428aa904563ca5441ae2659f669ad9345037798749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.5 CPython/3.7.1 Darwin/18.2.0
|
Release files / jsonmask-0.1.1-py2.py3-none-any.whl
| Download URL | jsonmask-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0251c83f3530d21016dd50130e34cee17044f0b9da4a8ebef85197c9fff1ce67
|
|
BLAKE2b-256 checksum How to use checksums |
99ef6b9f0ef4347d8a0365e7ba28092d8f5625c2e370e704c707be7160b91819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.5 CPython/3.7.1 Darwin/18.2.0
|