Graphinate


NameGraphinate JSON
Version 0.8.3 PyPI version JSON
download
home_pageNone
SummaryGraphinate. Data to Graphs.
upload_time2025-03-20 14:04:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords declarative graph
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # [Graphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)

<img height="360" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs.">

<table>
  <tr style="vertical-align: middle;">
    <td>Package</td>
    <td>
      <img alt="PyPI - version" src="https://img.shields.io/pypi/v/graphinate.svg?logo=pypi&logoColor=lightblue">
      <img alt="PyPI - Status" src="https://img.shields.io/pypi/status/graphinate.svg?logo=pypi&logoColor=lightblue">
      <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/graphinate.svg?logo=python&label=Python&logoColor=lightblue">
      <img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dd/graphinate.svg?logo=pypi&logoColor=lightblue">
      <img alt="Libraries.io SourceRank" src="https://img.shields.io/librariesio/sourcerank/pypi/Graphinate.svg?logo=Libraries.io&label=SourceRank">
    </td>
  </tr>
  <tr style="vertical-align: middle;">
    <td>Code</td>
    <td>
      <img alt="GitHub" src="https://img.shields.io/github/license/erivlis/graphinate">
      <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/erivlis/graphinate.svg?label=Size&logo=git">
      <img alt="GitHub last commit (by committer)" src="https://img.shields.io/github/last-commit/erivlis/graphinate.svg?&logo=git">
      <a href="https://github.com/erivlis/graphinate/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/erivlis/graphinate.svg?&logo=git"></a>
    </td>
  </tr>
  <tr style="vertical-align: middle;">
    <td>Tools</td>
    <td>
      <a href="https://www.jetbrains.com/pycharm/"><img alt="PyCharm" src="https://img.shields.io/badge/PyCharm-FCF84A.svg?logo=PyCharm&logoColor=black&labelColor=21D789&color=FCF84A"></a>
      <a href="https://github.com/astral-sh/uv"><img alt="uv" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" style="max-width:100%;"></a>
      <a href="https://github.com/astral-sh/ruff"><img alt="ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" style="max-width:100%;"></a>
      <a href="https://github.com/tox-dev/pipdeptree"><img alt="pipdeptree" src="https://img.shields.io/badge/pipdeptree-526CFE.svg?labelColor=gray&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADFElEQVR4nFxTW2tcVRRe39773E/mliZjwKRmhBaKt4BWRKmGgihCH3xUKNWC/Q/ii76IP8AHpSIiRfqmD5YKCinalhgiCMZLSVtMM0mTdDLTuZyZc9l7yTlp7WXBgXPW+fa31rfWtxU9FLMN79Crr028e+iJsZfb7fJMp23xRlOvbTR3L/y5cuOL3Vbv7/vxuPviecI/eWr6k/mj4+8AkM11y+zs2MKwMJvNgIgYINZX/rlx+tIvf72fZXr4P0EQyOCjjw98P9vwn8+/+z3Bq6sek7AJkNhsOjQcyjvFmHd2upd+PP/zsSxNI5mnPvjw8U9fPFJ9XVkgNuDVayEbcgVEfgikNfFg4JAmh1LyyfGq06QqE9vN6+fEs4fHnjv25vjbAOA4AsL2MVZ1hRcI4QXIH7ilMqQXkiYXRBJRbFNQnTsRlqfmxFvH66ccFyAQMxP3I5cqNZBSxIWcKORMO9g3yeSHzFkGbnVCIkDUZ+beEy+8VJ4XguC6TMPYokwrCAHUJsBxYptoFBYSMi0oLIlcAkuFYhal8Zl5VanZU0zErgfurufMFjEkWZ7iRFY4SlgYfW9bUIJKFQNjiNPYf1QZOZn/hTaStPQKTI4eDCxSjsL4I6BeJzOjgcnT0HqPqwBJCdHZjW/miWjkkG3hzqKIe5FVlM3llGuWqOxTDMBkWlJ/6PB2p0Sb21gXixdvLeTtDGOHLFvQHpkiYyTuNU5kuxJercTdpEK3Bz4yLdFrXVsQ33x1/bModjhvyrKKVXB/YD9gb8PgKAlolAZipmFTOIYcxq21Xz8XS5dbi+e+2zqbA3MjxYninH3PpkyZljwYjZE2FoxBIWm6YVHaW/k66qwtF05curz509OHHzvqBqWp232fE+2AoCjOXNMfhcRcjAxxoijNFNpbG0vL588cNzpLC4I00cnCD1fPBuVqffbA5DMGNjR5MOSBpC+UYxGE5G5PmNXff/vy4rdnTmRJHD1wG+9G42D9qVfeePLk/oONI8qv7+/2fbq11f53ZfnqhStLi6d3b67/cT/+vwAAAP//Xo5dwOtdLi4AAAAASUVORK5CYII="></a>
      <a href="https://squidfunk.github.io/mkdocs-material/"><img alt="mkdocs-material" src="https://img.shields.io/badge/Material_for_MkDocs-526CFE?&logo=MaterialForMkDocs&logoColor=white&labelColor=grey"></a>
      <a href="https://hatch.pypa.io"><img alt="Hatch project" class="off-glb" loading="lazy" src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg"></a>
    </td>
  </tr>
  <tr style="vertical-align: middle;">
    <td>CI/CD</td>
    <td>
      <a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="Test" src="https://github.com/erivlis/graphinate/actions/workflows/test.yml/badge.svg"></a>
      <a href="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml"><img alt="Test (Beta)" src="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml/badge.svg"></a>
      <a href="https://github.com/erivlis/graphinate/actions/workflows/publish.yml"><img alt="Publish" src="https://github.com/erivlis/graphinate/actions/workflows/publish.yml/badge.svg"></a>
      <a href="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml"><img alt="Publish Docs" src="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml/badge.svg"></a>
    </td>
  </tr>
  <tr style="vertical-align: middle;">
    <td>Scans</td>
    <td>
      <a href="https://codecov.io/gh/erivlis/graphinate"><img alt="Coverage" src="https://codecov.io/gh/erivlis/graphinate/graph/badge.svg?token=POODT8M9NV"/></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Quality Gate Status" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=alert_status"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Security Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=security_rating"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Maintainability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=sqale_rating"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Reliability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=reliability_rating"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Lines of Code" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=ncloc"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Vulnerabilities" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=vulnerabilities"></a>
      <a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Bugs" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=bugs"></a>
      <a href="https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy Badge" src="https://app.codacy.com/project/badge/Grade/54b33c3f7313448f9471d01e2a06f037"></a>
      <a href="https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage"><img alt="Codacy Coverage" src="https://app.codacy.com/project/badge/Coverage/54b33c3f7313448f9471d01e2a06f037"/></a>
      <a href="https://scrutinizer-ci.com/g/erivlis/graphinate"><img alt="Scrutinizer" src="https://scrutinizer-ci.com/g/erivlis/graphinate/badges/quality-score.png?b=main"></a>
      <a href="https://www.codefactor.io/repository/github/erivlis/graphinate"><img src="https://www.codefactor.io/repository/github/erivlis/graphinate/badge" alt="CodeFactor" /></a>
      <a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a>
    </td>
  </tr>
  <tr>
    <td>Mentions</td>
    <td>
      <a href="https://www.youtube.com/live/k01G0b0Y0Jg?si=030OT8sK3BqPyy8r&t=1028"><img alt="PythonBytes Podcast" src="https://img.shields.io/badge/Python_Bytes-Ep. 361-D7F9FF?logo=applepodcasts&labelColor=blue"></a>
      <a href="https://pythonhub.dev/digest/2024-03-10/"><img alt="Static Badge" src="https://img.shields.io/badge/PythonHub-2024.03.10-gold?labelColor=blue"></a>
    </td>
  </tr>
  <tr>
    <td>Badge</td>
    <td>
       <a href="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"><img alt="Graphinate" src="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"></a>
    </td>
  </tr>
</table>

## Table of Contents

- [Introduction](#introduction)
  - [What is Graphinate?](#what-is-graphinate)
  - [Links](#links)
- [Quick Start](#quick-start)
  - [Install](#install)
  - [Example](#example)
- [CLI](#cli)
  - [Commands](#commands)
    - [Save](#save)
    - [Server](#server)
- [Gallery](#gallery)
  - [Python AST](#python-ast)
  - [GitHub Repository](#github-repository)
  - [Python AST - 3D Force-Directed Animation](#python-ast---3d-force-directed-animation)
  - [Web Page Links](#web-page-links)
- [Development](#development)
  - [Ruff](#ruff)
  - [Test](#test)
    - [Standard (cobertura) XML Coverage Report](#standard-cobertura-xml-coverage-report)
    - [HTML Coverage Report](#html-coverage-report)
  - [Docs](#docs)
    - [test](#test-1)
    - [build](#build)
- [Acknowledgements](#acknowledgements)
  - [Dependencies](#dependencies)
    - [Python](#python)
    - [Javascript and HTML](#javascript-and-html)
  - [Dev Tools](#dev-tools)
  - [IDE](#ide)

## Introduction

### What is Graphinate?

**Graphinate** is a python library that can be used to generate Graph Data Structures from Data Sources.

It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to map
data payloads and hierarchies to a Graph.

In addition, there are several modes of output to enable examination of the Graph and its content.

**Graphinate** uses and builds upon the excellent [**_NetworkX_**](https://networkx.org/).

### Links

- Website (including documentation): <https://erivlis.github.io/graphinate>
- Source: <https://github.com/erivlis/graphinate>
- Package: <https://pypi.org/project/graphinate>

## Quick Start

### Install

**Graphinate** is available on PyPI:

```shell
pip install graphinate
```

To install with server support

```shell
pip install graphinate[server]
```

**Graphinate** officially supports Python >= 3.10.

### Example

```python title="Octagonal Graph"
import graphinate

N: int = 8

# First Define a GraphModel instance.
# It will be used to hold the graph definitions
graph_model: graphinate.GraphModel = graphinate.model(name="Octagonal Graph")

# Register in the Graph Model the edges' supplier generator function
@graph_model.edge()
def edge():
    for i in range(N):
        yield {'source': i, 'target': i + 1}
    yield {'source': N, 'target': 0}


# Use the NetworkX Builder
builder = graphinate.builders.NetworkxBuilder(graph_model)

# build the NetworkX GraphRepresentation
# the output in this case is a nx.Graph instance
graph = builder.build()

# this supplied plot method uses matplotlib to display the graph
graphinate.matplotlib.plot(graph, with_edge_labels=True)

# or use the Mermaid Builder
builder = graphinate.builders.MermaidBuilder(graph_model)

# to create a Mermaid diagram
diagram: str = builder.build()

# and get Markdown or single page HTML to display it
mermaid_markdown: str = graphinate.mermaid.markdown(diagram)
mermaid_html: str = graphinate.mermaid.html(diagram, title=graph_model.name)

# or use the GraphQL Builder
builder = graphinate.builders.GraphQLBuilder(graph_model)

# to create a Strawberry GraphQL schema
schema = builder.build()

# and serve it using Uvicorn web server
graphinate.graphql.server(schema)
```
## CLI

### Commands

```text
Usage: python -m graphinate [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  save
  server
```

#### Save

```text
Usage: python -m graphinate save [OPTIONS]

Options:
  -m, --model MODEL  A GraphModel instance reference {module-
                     name}:{GraphModel-instance-variable-name} For example,
                     given var `model=GraphModel()` defined in app.py file,
                     then the  reference should be app:model
  --help             Show this message and exit.
```

#### Server

> TIP: requires the `server` extra to be installed. e.g., `pip install graphinate[server]`

```text
Usage: python -m graphinate server [OPTIONS]

Options:
  -m, --model MODEL   A GraphModel instance reference {module-
                      name}:{GraphModel-instance-variable-name} For example,
                      given var `model=GraphModel()` defined in app.py file,
                      then the  reference should be app:model
  -p, --port INTEGER  Port number.
  --help              Show this message and exit.
```

## Gallery

### Python Class AST

#### matplotlib

![graph_ast](https://github.com/erivlis/graphinate/assets/9897520/9e7e1ed2-3a5c-41fe-8c5f-999da4b741ff)

#### 3D Force-Directed Animation

<video width="400"  controls>
  <source src="https://github.com/erivlis/graphinate/assets/9897520/2e9a53b1-5686-4683-a0e4-fbffa850a27b" type="video/mp4">
</video>

### GitHub Repository

![repo_graph](https://github.com/erivlis/graphinate/assets/9897520/9c044bbe-1f21-41b8-b879-95b8362ad48d)


### Web Links

![Web Page Links](https://github.com/erivlis/graphinate/assets/9897520/ea5b00a2-75d1-4d0e-86af-272f20973149)

## Development

### Install dependencies

Use UV to install all dependencies

```shell
uv sync --all-extras --all-groups
```

### Update dependencies

```shell
uv lock --upgrade
uv sync --all-extras --all-groups
```

### Ruff

#### Report issues

```shell
ruff check src
```

#### Fix issues

```shell
ruff check src --fix
```

### Test

#### Standard (cobertura) XML Coverage Report

```shell
 python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=junit.xml
```

#### HTML Coverage Report

```shell
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=junit.xml
```

#### Terminal Coverage Report

```shell
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=junit.xml
```

### Docs

#### test

```shell
python -m mkdocs serve
```

#### build

```shell
python -m mkdocs build
```

## Acknowledgements

### Dependencies

#### Python

<a href="https://palletsprojects.com/p/click/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://click.palletsprojects.com/en/7.x/_images/click-logo.png" alt="Click Logo"></a>
<a href="https://github.com/Delgan/loguru"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://raw.githubusercontent.com/Delgan/loguru/master/docs/_static/img/logo.png" alt="Loguru Logo"></a>
<a href="https://matplotlib.org/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://matplotlib.org/_static/logo_dark.svg" alt="matplotlib Logo."></a>
<a href="https://networkx.org/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://networkx.org/_static/networkx_logo.svg" alt="NetworkX Logo."></a>
<a href="https://strawberry.rocks/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://github.com/strawberry-graphql/strawberry/raw/main/.github/logo.png" alt="Strawberry GraphQL Logo"></a>

#### Javascript and HTML

<a href="https://vasturiano.github.io/3d-force-graph/"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="http://gist.github.com/vasturiano/02affe306ce445e423f992faeea13521/raw/preview.png" alt="3D Force-Directed Graph Logo"></a>
<a href="https://github.com/graphql-kit/graphql-voyager"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://github.com/graphql-kit/graphql-voyager/raw/main/docs/cover.png" alt="Graphql Voyager Logo"></a>
<a href="https://github.com/cocopon/tweakpane"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://user-images.githubusercontent.com/602961/184479032-38f50be3-e235-4914-85c0-dce316b33ed2.png" alt="Tweakpane Logo"></a>

### Dev Tools

<a href="https://hatch.pypa.io/"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://hatch.pypa.io/latest/assets/images/logo.svg" alt="Hatch logo."></a>
<a href="https://squidfunk.github.io/mkdocs-material/"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg" alt="Material for MkDocs"></a>
<a href="https://pytest.org"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://docs.pytest.org/en/7.4.x/_static/pytest_logo_curves.svg" alt="pytest logo"></a>
<a href="https://astral.sh/ruff"><img height="60" style="background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://astralcms.wpengine.com/wp-content/uploads/2023/03/Ruff-Logo.svg" alt="Ruff logo"></a>
<a href="https://astral.sh/uv"><img height="60" style="padding: 16px; background: #261230;" src="https://docs.astral.sh/uv/assets/logo-letter.svg" alt="uv logo"></a>

### IDE

<a href="https://www.jetbrains.com/pycharm/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo"></a>

--------------------------------

![Alt](https://repobeats.axiom.co/api/embed/683f50f1d2de0e13e468c34a692612c2de4d56bd.svg "Repobeats analytics image")

--------------------------------

<img alt="Work on my Machine" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">

Copyright © 2023-2025 Eran Rivlis

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Graphinate",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "declarative, graph",
    "author": null,
    "author_email": "Eran Rivlis <eran@rivlis.info>",
    "download_url": "https://files.pythonhosted.org/packages/1a/ac/1922e8efd87ab1e6b7d5d03743110c354c2375f6fdf8b3a6c1a9df9ff477/graphinate-0.8.3.tar.gz",
    "platform": null,
    "description": "# [Graphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)\n\n<img height=\"360\" src=\"https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32\" alt=\"Graphinate. Data to Graphs.\">\n\n<table>\n  <tr style=\"vertical-align: middle;\">\n    <td>Package</td>\n    <td>\n      <img alt=\"PyPI - version\" src=\"https://img.shields.io/pypi/v/graphinate.svg?logo=pypi&logoColor=lightblue\">\n      <img alt=\"PyPI - Status\" src=\"https://img.shields.io/pypi/status/graphinate.svg?logo=pypi&logoColor=lightblue\">\n      <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/graphinate.svg?logo=python&label=Python&logoColor=lightblue\">\n      <img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dd/graphinate.svg?logo=pypi&logoColor=lightblue\">\n      <img alt=\"Libraries.io SourceRank\" src=\"https://img.shields.io/librariesio/sourcerank/pypi/Graphinate.svg?logo=Libraries.io&label=SourceRank\">\n    </td>\n  </tr>\n  <tr style=\"vertical-align: middle;\">\n    <td>Code</td>\n    <td>\n      <img alt=\"GitHub\" src=\"https://img.shields.io/github/license/erivlis/graphinate\">\n      <img alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/erivlis/graphinate.svg?label=Size&logo=git\">\n      <img alt=\"GitHub last commit (by committer)\" src=\"https://img.shields.io/github/last-commit/erivlis/graphinate.svg?&logo=git\">\n      <a href=\"https://github.com/erivlis/graphinate/graphs/contributors\"><img alt=\"Contributors\" src=\"https://img.shields.io/github/contributors/erivlis/graphinate.svg?&logo=git\"></a>\n    </td>\n  </tr>\n  <tr style=\"vertical-align: middle;\">\n    <td>Tools</td>\n    <td>\n      <a href=\"https://www.jetbrains.com/pycharm/\"><img alt=\"PyCharm\" src=\"https://img.shields.io/badge/PyCharm-FCF84A.svg?logo=PyCharm&logoColor=black&labelColor=21D789&color=FCF84A\"></a>\n      <a href=\"https://github.com/astral-sh/uv\"><img alt=\"uv\" src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json\" style=\"max-width:100%;\"></a>\n      <a href=\"https://github.com/astral-sh/ruff\"><img alt=\"ruff\" src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" style=\"max-width:100%;\"></a>\n      <a href=\"https://github.com/tox-dev/pipdeptree\"><img alt=\"pipdeptree\" src=\"https://img.shields.io/badge/pipdeptree-526CFE.svg?labelColor=gray&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADFElEQVR4nFxTW2tcVRRe39773E/mliZjwKRmhBaKt4BWRKmGgihCH3xUKNWC/Q/ii76IP8AHpSIiRfqmD5YKCinalhgiCMZLSVtMM0mTdDLTuZyZc9l7yTlp7WXBgXPW+fa31rfWtxU9FLMN79Crr028e+iJsZfb7fJMp23xRlOvbTR3L/y5cuOL3Vbv7/vxuPviecI/eWr6k/mj4+8AkM11y+zs2MKwMJvNgIgYINZX/rlx+tIvf72fZXr4P0EQyOCjjw98P9vwn8+/+z3Bq6sek7AJkNhsOjQcyjvFmHd2upd+PP/zsSxNI5mnPvjw8U9fPFJ9XVkgNuDVayEbcgVEfgikNfFg4JAmh1LyyfGq06QqE9vN6+fEs4fHnjv25vjbAOA4AsL2MVZ1hRcI4QXIH7ilMqQXkiYXRBJRbFNQnTsRlqfmxFvH66ccFyAQMxP3I5cqNZBSxIWcKORMO9g3yeSHzFkGbnVCIkDUZ+beEy+8VJ4XguC6TMPYokwrCAHUJsBxYptoFBYSMi0oLIlcAkuFYhal8Zl5VanZU0zErgfurufMFjEkWZ7iRFY4SlgYfW9bUIJKFQNjiNPYf1QZOZn/hTaStPQKTI4eDCxSjsL4I6BeJzOjgcnT0HqPqwBJCdHZjW/miWjkkG3hzqKIe5FVlM3llGuWqOxTDMBkWlJ/6PB2p0Sb21gXixdvLeTtDGOHLFvQHpkiYyTuNU5kuxJercTdpEK3Bz4yLdFrXVsQ33x1/bModjhvyrKKVXB/YD9gb8PgKAlolAZipmFTOIYcxq21Xz8XS5dbi+e+2zqbA3MjxYninH3PpkyZljwYjZE2FoxBIWm6YVHaW/k66qwtF05curz509OHHzvqBqWp232fE+2AoCjOXNMfhcRcjAxxoijNFNpbG0vL588cNzpLC4I00cnCD1fPBuVqffbA5DMGNjR5MOSBpC+UYxGE5G5PmNXff/vy4rdnTmRJHD1wG+9G42D9qVfeePLk/oONI8qv7+/2fbq11f53ZfnqhStLi6d3b67/cT/+vwAAAP//Xo5dwOtdLi4AAAAASUVORK5CYII=\"></a>\n      <a href=\"https://squidfunk.github.io/mkdocs-material/\"><img alt=\"mkdocs-material\" src=\"https://img.shields.io/badge/Material_for_MkDocs-526CFE?&logo=MaterialForMkDocs&logoColor=white&labelColor=grey\"></a>\n      <a href=\"https://hatch.pypa.io\"><img alt=\"Hatch project\" class=\"off-glb\" loading=\"lazy\" src=\"https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\"></a>\n    </td>\n  </tr>\n  <tr style=\"vertical-align: middle;\">\n    <td>CI/CD</td>\n    <td>\n      <a href=\"https://github.com/erivlis/graphinate/actions/workflows/test.yml\"><img alt=\"Test\" src=\"https://github.com/erivlis/graphinate/actions/workflows/test.yml/badge.svg\"></a>\n      <a href=\"https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml\"><img alt=\"Test (Beta)\" src=\"https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml/badge.svg\"></a>\n      <a href=\"https://github.com/erivlis/graphinate/actions/workflows/publish.yml\"><img alt=\"Publish\" src=\"https://github.com/erivlis/graphinate/actions/workflows/publish.yml/badge.svg\"></a>\n      <a href=\"https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml\"><img alt=\"Publish Docs\" src=\"https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml/badge.svg\"></a>\n    </td>\n  </tr>\n  <tr style=\"vertical-align: middle;\">\n    <td>Scans</td>\n    <td>\n      <a href=\"https://codecov.io/gh/erivlis/graphinate\"><img alt=\"Coverage\" src=\"https://codecov.io/gh/erivlis/graphinate/graph/badge.svg?token=POODT8M9NV\"/></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Quality Gate Status\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=alert_status\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Security Rating\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=security_rating\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Maintainability Rating\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=sqale_rating\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Reliability Rating\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=reliability_rating\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Lines of Code\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=ncloc\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Vulnerabilities\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=vulnerabilities\"></a>\n      <a href=\"https://sonarcloud.io/summary/new_code?id=erivlis_graphinate\"><img alt=\"Bugs\" src=\"https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=bugs\"></a>\n      <a href=\"https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade\"><img alt=\"Codacy Badge\" src=\"https://app.codacy.com/project/badge/Grade/54b33c3f7313448f9471d01e2a06f037\"></a>\n      <a href=\"https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage\"><img alt=\"Codacy Coverage\" src=\"https://app.codacy.com/project/badge/Coverage/54b33c3f7313448f9471d01e2a06f037\"/></a>\n      <a href=\"https://scrutinizer-ci.com/g/erivlis/graphinate\"><img alt=\"Scrutinizer\" src=\"https://scrutinizer-ci.com/g/erivlis/graphinate/badges/quality-score.png?b=main\"></a>\n      <a href=\"https://www.codefactor.io/repository/github/erivlis/graphinate\"><img src=\"https://www.codefactor.io/repository/github/erivlis/graphinate/badge\" alt=\"CodeFactor\" /></a>\n      <a href=\"https://snyk.io/test/github/erivlis/graphinate\"><img alt=\"Snyk\" src=\"https://snyk.io/test/github/erivlis/Graphinate/badge.svg\"></a>\n    </td>\n  </tr>\n  <tr>\n    <td>Mentions</td>\n    <td>\n      <a href=\"https://www.youtube.com/live/k01G0b0Y0Jg?si=030OT8sK3BqPyy8r&t=1028\"><img alt=\"PythonBytes Podcast\" src=\"https://img.shields.io/badge/Python_Bytes-Ep. 361-D7F9FF?logo=applepodcasts&labelColor=blue\"></a>\n      <a href=\"https://pythonhub.dev/digest/2024-03-10/\"><img alt=\"Static Badge\" src=\"https://img.shields.io/badge/PythonHub-2024.03.10-gold?labelColor=blue\"></a>\n    </td>\n  </tr>\n  <tr>\n    <td>Badge</td>\n    <td>\n       <a href=\"https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet\"><img alt=\"Graphinate\" src=\"https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet\"></a>\n    </td>\n  </tr>\n</table>\n\n## Table of Contents\n\n- [Introduction](#introduction)\n  - [What is Graphinate?](#what-is-graphinate)\n  - [Links](#links)\n- [Quick Start](#quick-start)\n  - [Install](#install)\n  - [Example](#example)\n- [CLI](#cli)\n  - [Commands](#commands)\n    - [Save](#save)\n    - [Server](#server)\n- [Gallery](#gallery)\n  - [Python AST](#python-ast)\n  - [GitHub Repository](#github-repository)\n  - [Python AST - 3D Force-Directed Animation](#python-ast---3d-force-directed-animation)\n  - [Web Page Links](#web-page-links)\n- [Development](#development)\n  - [Ruff](#ruff)\n  - [Test](#test)\n    - [Standard (cobertura) XML Coverage Report](#standard-cobertura-xml-coverage-report)\n    - [HTML Coverage Report](#html-coverage-report)\n  - [Docs](#docs)\n    - [test](#test-1)\n    - [build](#build)\n- [Acknowledgements](#acknowledgements)\n  - [Dependencies](#dependencies)\n    - [Python](#python)\n    - [Javascript and HTML](#javascript-and-html)\n  - [Dev Tools](#dev-tools)\n  - [IDE](#ide)\n\n## Introduction\n\n### What is Graphinate?\n\n**Graphinate** is a python library that can be used to generate Graph Data Structures from Data Sources.\n\nIt can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to map\ndata payloads and hierarchies to a Graph.\n\nIn addition, there are several modes of output to enable examination of the Graph and its content.\n\n**Graphinate** uses and builds upon the excellent [**_NetworkX_**](https://networkx.org/).\n\n### Links\n\n- Website (including documentation): <https://erivlis.github.io/graphinate>\n- Source: <https://github.com/erivlis/graphinate>\n- Package: <https://pypi.org/project/graphinate>\n\n## Quick Start\n\n### Install\n\n**Graphinate** is available on PyPI:\n\n```shell\npip install graphinate\n```\n\nTo install with server support\n\n```shell\npip install graphinate[server]\n```\n\n**Graphinate** officially supports Python >= 3.10.\n\n### Example\n\n```python title=\"Octagonal Graph\"\nimport graphinate\n\nN: int = 8\n\n# First Define a GraphModel instance.\n# It will be used to hold the graph definitions\ngraph_model: graphinate.GraphModel = graphinate.model(name=\"Octagonal Graph\")\n\n# Register in the Graph Model the edges' supplier generator function\n@graph_model.edge()\ndef edge():\n    for i in range(N):\n        yield {'source': i, 'target': i + 1}\n    yield {'source': N, 'target': 0}\n\n\n# Use the NetworkX Builder\nbuilder = graphinate.builders.NetworkxBuilder(graph_model)\n\n# build the NetworkX GraphRepresentation\n# the output in this case is a nx.Graph instance\ngraph = builder.build()\n\n# this supplied plot method uses matplotlib to display the graph\ngraphinate.matplotlib.plot(graph, with_edge_labels=True)\n\n# or use the Mermaid Builder\nbuilder = graphinate.builders.MermaidBuilder(graph_model)\n\n# to create a Mermaid diagram\ndiagram: str = builder.build()\n\n# and get Markdown or single page HTML to display it\nmermaid_markdown: str = graphinate.mermaid.markdown(diagram)\nmermaid_html: str = graphinate.mermaid.html(diagram, title=graph_model.name)\n\n# or use the GraphQL Builder\nbuilder = graphinate.builders.GraphQLBuilder(graph_model)\n\n# to create a Strawberry GraphQL schema\nschema = builder.build()\n\n# and serve it using Uvicorn web server\ngraphinate.graphql.server(schema)\n```\n## CLI\n\n### Commands\n\n```text\nUsage: python -m graphinate [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  save\n  server\n```\n\n#### Save\n\n```text\nUsage: python -m graphinate save [OPTIONS]\n\nOptions:\n  -m, --model MODEL  A GraphModel instance reference {module-\n                     name}:{GraphModel-instance-variable-name} For example,\n                     given var `model=GraphModel()` defined in app.py file,\n                     then the  reference should be app:model\n  --help             Show this message and exit.\n```\n\n#### Server\n\n> TIP: requires the `server` extra to be installed. e.g., `pip install graphinate[server]`\n\n```text\nUsage: python -m graphinate server [OPTIONS]\n\nOptions:\n  -m, --model MODEL   A GraphModel instance reference {module-\n                      name}:{GraphModel-instance-variable-name} For example,\n                      given var `model=GraphModel()` defined in app.py file,\n                      then the  reference should be app:model\n  -p, --port INTEGER  Port number.\n  --help              Show this message and exit.\n```\n\n## Gallery\n\n### Python Class AST\n\n#### matplotlib\n\n![graph_ast](https://github.com/erivlis/graphinate/assets/9897520/9e7e1ed2-3a5c-41fe-8c5f-999da4b741ff)\n\n#### 3D Force-Directed Animation\n\n<video width=\"400\"  controls>\n  <source src=\"https://github.com/erivlis/graphinate/assets/9897520/2e9a53b1-5686-4683-a0e4-fbffa850a27b\" type=\"video/mp4\">\n</video>\n\n### GitHub Repository\n\n![repo_graph](https://github.com/erivlis/graphinate/assets/9897520/9c044bbe-1f21-41b8-b879-95b8362ad48d)\n\n\n### Web Links\n\n![Web Page Links](https://github.com/erivlis/graphinate/assets/9897520/ea5b00a2-75d1-4d0e-86af-272f20973149)\n\n## Development\n\n### Install dependencies\n\nUse UV to install all dependencies\n\n```shell\nuv sync --all-extras --all-groups\n```\n\n### Update dependencies\n\n```shell\nuv lock --upgrade\nuv sync --all-extras --all-groups\n```\n\n### Ruff\n\n#### Report issues\n\n```shell\nruff check src\n```\n\n#### Fix issues\n\n```shell\nruff check src --fix\n```\n\n### Test\n\n#### Standard (cobertura) XML Coverage Report\n\n```shell\n python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=junit.xml\n```\n\n#### HTML Coverage Report\n\n```shell\npython -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=junit.xml\n```\n\n#### Terminal Coverage Report\n\n```shell\npython -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=junit.xml\n```\n\n### Docs\n\n#### test\n\n```shell\npython -m mkdocs serve\n```\n\n#### build\n\n```shell\npython -m mkdocs build\n```\n\n## Acknowledgements\n\n### Dependencies\n\n#### Python\n\n<a href=\"https://palletsprojects.com/p/click/\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://click.palletsprojects.com/en/7.x/_images/click-logo.png\" alt=\"Click Logo\"></a>\n<a href=\"https://github.com/Delgan/loguru\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://raw.githubusercontent.com/Delgan/loguru/master/docs/_static/img/logo.png\" alt=\"Loguru Logo\"></a>\n<a href=\"https://matplotlib.org/\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://matplotlib.org/_static/logo_dark.svg\" alt=\"matplotlib Logo.\"></a>\n<a href=\"https://networkx.org/\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://networkx.org/_static/networkx_logo.svg\" alt=\"NetworkX Logo.\"></a>\n<a href=\"https://strawberry.rocks/\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://github.com/strawberry-graphql/strawberry/raw/main/.github/logo.png\" alt=\"Strawberry GraphQL Logo\"></a>\n\n#### Javascript and HTML\n\n<a href=\"https://vasturiano.github.io/3d-force-graph/\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"http://gist.github.com/vasturiano/02affe306ce445e423f992faeea13521/raw/preview.png\" alt=\"3D Force-Directed Graph Logo\"></a>\n<a href=\"https://github.com/graphql-kit/graphql-voyager\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://github.com/graphql-kit/graphql-voyager/raw/main/docs/cover.png\" alt=\"Graphql Voyager Logo\"></a>\n<a href=\"https://github.com/cocopon/tweakpane\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://user-images.githubusercontent.com/602961/184479032-38f50be3-e235-4914-85c0-dce316b33ed2.png\" alt=\"Tweakpane Logo\"></a>\n\n### Dev Tools\n\n<a href=\"https://hatch.pypa.io/\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://hatch.pypa.io/latest/assets/images/logo.svg\" alt=\"Hatch logo.\"></a>\n<a href=\"https://squidfunk.github.io/mkdocs-material/\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg\" alt=\"Material for MkDocs\"></a>\n<a href=\"https://pytest.org\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://docs.pytest.org/en/7.4.x/_static/pytest_logo_curves.svg\" alt=\"pytest logo\"></a>\n<a href=\"https://astral.sh/ruff\"><img height=\"60\" style=\"background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);\" src=\"https://astralcms.wpengine.com/wp-content/uploads/2023/03/Ruff-Logo.svg\" alt=\"Ruff logo\"></a>\n<a href=\"https://astral.sh/uv\"><img height=\"60\" style=\"padding: 16px; background: #261230;\" src=\"https://docs.astral.sh/uv/assets/logo-letter.svg\" alt=\"uv logo\"></a>\n\n### IDE\n\n<a href=\"https://www.jetbrains.com/pycharm/\"><img height=\"60\" style=\"padding: 5px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);\" src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png\" alt=\"PyCharm logo\"></a>\n\n--------------------------------\n\n![Alt](https://repobeats.axiom.co/api/embed/683f50f1d2de0e13e468c34a692612c2de4d56bd.svg \"Repobeats analytics image\")\n\n--------------------------------\n\n<img alt=\"Work on my Machine\" src=\"https://forthebadge.com/images/badges/works-on-my-machine.svg\">\n\nCopyright \u00a9 2023-2025 Eran Rivlis\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Graphinate. Data to Graphs.",
    "version": "0.8.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/erivlis/graphinate/issues",
        "Documentation": "https://erivlis.github.io/graphinate",
        "Homepage": "https://erivlis.github.io/graphinate",
        "Source": "https://github.com/erivlis/graphinate"
    },
    "split_keywords": [
        "declarative",
        " graph"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "803fb8d922836d4e07e934fa48cea75ccd2aa60a09fb69c3b87857c8ff65c6d8",
                "md5": "c0b37e33c1a847279e6564aa5af68c62",
                "sha256": "967385a668cb077c8b72e4fcccaaf2e362e4cf1a0908f774fe6e747b28f937e3"
            },
            "downloads": -1,
            "filename": "graphinate-0.8.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0b37e33c1a847279e6564aa5af68c62",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 111032,
            "upload_time": "2025-03-20T14:04:15",
            "upload_time_iso_8601": "2025-03-20T14:04:15.201064Z",
            "url": "https://files.pythonhosted.org/packages/80/3f/b8d922836d4e07e934fa48cea75ccd2aa60a09fb69c3b87857c8ff65c6d8/graphinate-0.8.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1aac1922e8efd87ab1e6b7d5d03743110c354c2375f6fdf8b3a6c1a9df9ff477",
                "md5": "e4786123e33ec4a15e75a8195ccbb1f3",
                "sha256": "492e52d98bd9d5f5834a709c72c0784cd664c04de3db0112e3b9f9268e76e603"
            },
            "downloads": -1,
            "filename": "graphinate-0.8.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e4786123e33ec4a15e75a8195ccbb1f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 2256750,
            "upload_time": "2025-03-20T14:04:16",
            "upload_time_iso_8601": "2025-03-20T14:04:16.758561Z",
            "url": "https://files.pythonhosted.org/packages/1a/ac/1922e8efd87ab1e6b7d5d03743110c354c2375f6fdf8b3a6c1a9df9ff477/graphinate-0.8.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-20 14:04:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erivlis",
    "github_project": "graphinate",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "graphinate"
}
        
Elapsed time: 0.47453s