Implements the Google Partial Response protocol in Python
Project description
Overview
Implements Google Partial Response / json-mask
in Python.
jsonmask_ng is a fork of jsonmask from Zapier that seems discontinued.
Requirements
- Python 2.7
- Python 3.7
Installation
Install jsonmask_ng with pip:
$ pip install jsonmask_ng
or directly from the source code:
$ git clone https://github.com/juanyque/jsonmask_ng.git
$ cd jsonmask_ng
$ python setup.py install
Usage
After installation, the package can imported:
$ python
>>> import jsonmask_ng
>>> jsonmask_ng.__version__
To prune dictionaries:
>>> import jsonmask_ng
>>> mask = jsonmask_ng.parse_fields('a,b(c,d)')
>>> jsonmask_ng.apply_json_mask(
{
'a': {
'nested_within_a': True,
},
'b': {
'c': True,
'd': {'Will get included?': 'Yes'},
'e': 'Tough luck here',
},
'c': 'Definitely hopeless',
},
mask,
)
Output:
{
'a': {
'nested_within_a': True,
},
'b': {
'c': True,
'd': {'Will get included?': 'Yes'},
},
}
Contribute
To setup an appropriate dev environment:
-
With docker environment available
-
run: `./docker_start.sh``
-
run tests
make test
-
Clean (test, cache, ...)
make clean
-
Clean (test, cache, ... including virtualenv)
make clean-all
(you will need amake all
after this) -
Build dist package:
make build
-
Set PyPI credentials: `poetry config pypi-token.pypi pypi-xxxxxTOKENXxxx``
-
Build dist package:
make upload
Util commands:
- To fix poetry.lock with minimal changes:
poetry lock --no-update
- To fix poetry.lock updating package versions:
poetry lock
(this could don't work) - After
poetry lock...
probably you will need to domake all
to update packages on virtualenv
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
Built Distribution
Hashes for jsonmask_ng-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 003c74434738d1c9cc90027cf6210730645ca9075b0e2523cf3a006f0565488b |
|
MD5 | f39a50ef26592f3449a1b1c28bb62c6c |
|
BLAKE2b-256 | 89e0f19e30fa10f7ea55da103c79a4a743c188b43a2835856770ce44e9b65253 |