https://github.com/apiwatcher/jsonderef
https://github.com/apiwatcher/jsonderef
dereference json python reference rfc-6091
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/apiwatcher/jsonderef
- Owner: apiwatcher
- License: mit
- Created: 2017-06-12T14:46:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-22T17:56:16.000Z (over 6 years ago)
- Last Synced: 2025-12-04T04:41:10.107Z (7 months ago)
- Topics: dereference, json, python, reference, rfc-6091
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
jsonderef
==========
A json dereferencing library for python.
Json pointers evaluation is compliant with rfc 6901
(https://tools.ietf.org/html/rfc6901).
Installation
=============
Best way is to use *pip*.
.. code-block:: shell
pip install jsonderef
Usage
======
.. code-block:: python
from jsonderef import JsonDeref
document = {
"key": "value",
"ref": {"$ref": "#/key"},
"array_ref": [ {"$ref": "#/key"}],
"nested_ref": { "nest": {"$ref": "#/nested_ref"}}
}
dereferencer = JsonDeref()
print dereferencer.deref(document, max_deref_depth=5)
Tests
======
Clone the repo, install dependencies and run nose.
.. code-block:: shell
virtualenv env
. env/bin/activate
pip install -r requirements.txt
nosetests tests.py