Extensible command-line REPL for interacting with JSON-graphs containing business objects
Project description
Extensible command-line REPL for interacting with JSON graphs containing business objects.
The JSON format is based on the json-graph specification at: https://github.com/jsongraph/json-graph-specification
Several additional assumptions are made:
We assume that the graph contains no cycles
We treat node IDs as case-insensitive
There are certain metadata fields that some aspects of the tool depend on (but none of these are mandatory)
Sample graphs are provided in the tests directory.
To use from the command line, just point the jgrepl tool to your JSON graph:
$ ./jgrepl/jgrepl.py tests/food-graph.json
Once in the REPL, type help for the list of available commands. Use ctrl-d to exit.
Here is a sample session using the “food” graph:
*** Loading graph from 'tests/food-graph.json'...
JSON Graph REPL v.0.1.2
/> info // The `info` command displays information about the current node or graph
CURRENT GRAPH: Sample Food Graph ('tests/food-graph.json')
GRAPH TYPE: food graph
NODES: 14
EDGES: 11
{ // All metadata is shown here:
"version": "1.0"
}
/> ls -l
CAT1 category Vegetables
CAT2 category Fruits
CAT3 category Sweets
/> cd CAT3 // Change to a new path. Note the prompt changes to reflect your location.
/CAT3> info
NODE ID: cat3
NODE TYPE: category
NODE LABEL: Sweets
{
"available_from": "2017-07-18",
"available_to": "2017-11-18"
}
/CAT3> find food8 // Print all paths to this node ID
/CAT3/CAT32/FOOD8
/CAT3> cd $ // Switch to the last shown path
/CAT3/CAT32/FOOD8>
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jgrepl-0.1.4.tar.gz.
File metadata
- Download URL: jgrepl-0.1.4.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
106009488066eca54d81a12c071b9fc08e8f2809d6b3177dd76ee5ec41baba19
|
|
| MD5 |
20994b46132754d3fa24dd4ecccffef3
|
|
| BLAKE2b-256 |
ad505fb33e52c7842d9a1a002e91c1ad13efb93813138fa52bc92d359d481150
|
File details
Details for the file jgrepl-0.1.4-py3-none-any.whl.
File metadata
- Download URL: jgrepl-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60839bc1589ef91b629b18c67656a8366f470dde7d43d9c6b42fabaed27abec2
|
|
| MD5 |
29929e5825b77a39a710ca26f759cea5
|
|
| BLAKE2b-256 |
1aeb7390f1715a85d941c2cece577dccf6dfebf406008b18d57bdb4da3eb059c
|