No project description provided
Project description
Graph Data Generator
Package for generating interconnected mock data from .json graph data models.
JSON Spec
Is the same specification used by the arrows.app which is a GUI for generating graph data models. The .json spec has 2 required keys, nodes
and relationships
:
{
"nodes":[],
"relationships: []
}
Each must contain an array (or list) of dictionary objects with formats dependent on the key type:
Nodes must have the following property keys and value types:
{
"id": str,
"position": {
"x": float,
"y": float
},
"caption": string,
"labels": list[str],
"properties": dict[str:str],
"style": {}
}
Example:
{
"id": "n0",
"position": {
"x": -306.93969052033395,
"y": 271.3634778613202
},
"caption": "Person",
"labels": [],
"properties": {
"email": "test@email.com",
"salary_usd": "3000.00",
"first_name": "Jane",
"last_name": "Doe"
},
"style": {}
}
Relationships must have the following keys and value types:
{
"id": str,
"type": str,
"style": dict,
"properties": dict[str,str],
"fromId": str,
"toId": str
}
Example:
{
"id": "n0",
"type": "WORKS_AT",
"style": {},
"properties": {
"start_epoch":"1672904355",
"end_epoch":"1688542755"
},
"fromId": "n0",
"toId": "n1"
}
Installation
pip install graph-data-generator
To use in a project:
import graph_data_generator as gdg
To generate a .zip file and return as bytes, pass a json object as an arg:
bytes_file = gdg.generate_zip(json_object)
Package Usage
Build locally:
poetry build
To use in another poetry project:
import graph_data_generator as gdg
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 graph_data_generator-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a30f1bc74ca179d35791c1b867e327db9dffa5d6015d6a67253ee5df381b5d |
|
MD5 | 38fcd4a885d7ca80319488b5218c3bee |
|
BLAKE2b-256 | 0cbc7c9062d5d4f3e69c82a24451b2539f073742a5e9a74a63e1aaf8b8f7f0a3 |
Hashes for graph_data_generator-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dadff5f3266b1710e593b16c91175acc3092078a27825312a5420cd4a7813d9 |
|
MD5 | 768ce6b482ac8415368a4593c0a67311 |
|
BLAKE2b-256 | 6654826621e746ff902ef51ff7db0ebd7a5869dfeb7292ace48524b75ccf5cd4 |