Skip to main content

Graphinate. Data to Graphs.

Project description

Graphinate. Data to Graphs.

⚠️ 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

Install

Graphinate is available on PyPI:

python -m pip install graphinate 

Graphinate officially supports Python 3.9+.

Introduction

What is Graphinate?

Graphinate aims to simplify the generation of Graph data structures from sources of data. It utilizes and build upon NetworkX

What is a Graph?

In a mathematician's terminology, a graph is a collection of points and lines connecting some (possibly empty) subset of them. The points of a graph are most commonly known as graph vertices, but may also be called "nodes" or simply " points." Similarly, the lines connecting the vertices of a graph are most commonly known as graph edges, but may also be called "arcs" or "lines."

https://mathworld.wolfram.com/Graph.html

What is Data?

...data is a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted formally.

https://en.wikipedia.org/wiki/Data

Defining a Graph

One can define Graphs in two general ways:

Edge first

Generate a Graph by supplying a list of edges. The simplest definition of an edge will be a tuple of 2 values. Each value represent a node (or vertex) in the graph. Additional attributes may be also added to the edge definition to signify additional meaning.

In this case one defines the edges explicitly and the nodes implicitly.

Such graph is focused more on the relationships or the structure of the Graph than on the nodes themselves.

Node first

Alternatively, one can first add nodes (vertices) to a graph without defining edges. Additional attributes may be added to the node definition to signify additional meaning. Later on edge definitions are added to generate the relationships between the nodes.

In this case both nodes and the edges are defines explicitly.

Such a graph has focus first on the nodes and later on the relationship between them.

Gallery

d3_graph_ast repo_graph AST 3D Force animation

Examples

  • Code
    • Call Graph
    • Python AST
  • GitHub
    • Repository
    • Followers
  • Ethernet
    • Traceroute
  • Math
    • Graph Atlas
    • Hailstone
  • Text
    • NLP
  • Web
    • Web Graph

Guide

By Convention

https://github.com/erivlis/graphinate/blob/f5b363a360907aecf52cf11249b78666eb470d20/examples/github/followers.py#L1

By Configuration

https://github.com/erivlis/graphinate/blob/f5b363a360907aecf52cf11249b78666eb470d20/examples/github/repositories.py#L1

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.

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

3D Force-Directed Graph Logo. Click Logo. Loguru Logo. matplotlib Logo. NetworkX Logo. Strawberry GraphQL 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.8.tar.gz (128.8 kB view hashes)

Uploaded Source

Built Distribution

graphinate-0.0.8-py3-none-any.whl (69.8 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