Graphinate. Data to Graphs.
Project description
Graphinate. Data to Graphs.
[!WARNING] UNDER DEVELOPMENT
This library is alpha-quality
Introduction
What is Graphinate?
Graphinate is a library that aims to simplify the generation of Graph Data Structures from Data Sources.
It utilizes and builds upon the excellent NetworkX library.
In addition, it has several interfaces for ease of use:
- CLI (using Click),
- GraphQL API (using Strawberry GraphQL).
Install
Graphinate is available on PyPI:
pip install graphinate
To install with server support
pip install graphinate[server]
Graphinate officially supports Python 3.9+.
Quick Start
GraphModel
Graphinate defines the GraphModel
Class which can be used to declaratively register Edge and/or Node data
supplier functions by using decorators.
materialize
Graphinate supplies a materialize
function to output the GraphModel
.
Example
import graphinate
N: int = 8
# Define GraphModel
graph_model = graphinate.GraphModel(name="Octagonal Graph")
# Register edges supplier function
@graph_model.edge()
def edge():
for i in range(N):
yield {'source': i, 'target': i + 1}
yield {'source': N, 'target': 0}
# Materialize the GraphModel
graphinate.materialize(graph_model)
CLI
Commands
Usage: python -m graphinate [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
save
server
Save
Usage: python -m graphinate save [OPTIONS] MODEL
Options:
--help Show this message and exit.
Server
Usage: python -m graphinate server [OPTIONS] MODEL
Options:
-p, --port INTEGER
--help Show this message and exit.
TUI
UNDER DEVELOPMENT
Gallery
Python AST
GitHub Repository
Python AST - 3D Force-Directed Animation
Development
Lint
ruff check src
Docs
python -m mkdocs build
Build
python -m build
Test
python -m pytest ./tests --cov=./src --cov-branch --cov-report=xml --junitxml=test_results.xml
Acknowledgements
Dependencies
Python
Javascript and HTML
Dev Tools
IDE
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file graphinate-0.0.9.tar.gz
.
File metadata
- Download URL: graphinate-0.0.9.tar.gz
- Upload date:
- Size: 131.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44dbc09667ea64300b557fc57f505691028438ab74384adb4a0d64b399fd0cc |
|
MD5 | e60709a3126df704486c309fbe38643d |
|
BLAKE2b-256 | c406b85dcae8fb9ead2942b3825200043bec7fffcd42e8fc3ccb73351e9d61e1 |
Provenance
File details
Details for the file graphinate-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: graphinate-0.0.9-py3-none-any.whl
- Upload date:
- Size: 69.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 827ddf0795f056e86e20b3fafd3aa56a9dd2d5db410b8bbc3781c4c2003243d2 |
|
MD5 | 66c8a995591d4b1ea78c3aafbf66413f |
|
BLAKE2b-256 | 645d2e91a495b9c1aaae60fcd620ea7210d0aed71d98d6de05ae40b9ee9ebb28 |