Skip to main content

Graphinate. Data to Graphs.

Project description

Graphinate. Data to Graphs.

[!WARNING] UNDER DEVELOPMENT

This library is alpha-quality

PyPI PyPI - Status PyPI - Python Version GitHub PyPI - Downloads GitHub repo size Contributors GitHub last commit (by committer)

Tests Publish

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:

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

d3_graph_ast

GitHub Repository

repo_graph

Python AST - 3D Force-Directed Animation

AST 3D Force 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

Click Logo. Loguru Logo. matplotlib Logo. NetworkX Logo. Strawberry GraphQL Logo.

Javascript and HTML

3D Force-Directed Graph Logo. Graphql Voyager Logo.

Dev Tools

Hatch logo. pytest logo. Ruff logo.

IDE

PyCharm logo.

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

graphinate-0.0.9.tar.gz (131.0 kB view hashes)

Uploaded Source

Built Distribution

graphinate-0.0.9-py3-none-any.whl (69.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page