Skip to main content

Render NetworkX graphs using GraphViz

Project description

nxv

PyPI Status Tests Documentation Status Codecov

Render NetworkX graphs using GraphViz.

Documentation

https://nxv.readthedocs.io/

Basic Usage

import networkx as nx
import nxv

graph = nx.Graph()
graph.add_edge("A", "B")
graph.add_edge("B", "C")
graph.add_edge("C", "D")
graph.add_edge("B", "E")

style = nxv.Style(
    graph={"rankdir": "LR"},
    node=lambda u, d: {"shape": "circle" if u in "AEIOU" else "square"},
    edge=lambda u, v, d: {"style": "dashed", "label": u + v},
)

nxv.render(graph, style)

Installation

pip install nxv

Development

This repository uses Poetry and Nox to manage the development environment and builds.

To list all Nox sessions:

python -m nox --list-sessions

To run the black code formatter:

python -m nox -rs black

To lint using flake8:

python -m nox -rs lint

To run the test suite:

python -m nox -rs tests

To build the documentation:

python -m nox -rs docs

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

nxv-0.1.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

nxv-0.1.1-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file nxv-0.1.1.tar.gz.

File metadata

  • Download URL: nxv-0.1.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1025-azure

File hashes

Hashes for nxv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e0eb7cb86e251b4621388626522a377bf67b5ff9aca6abd2edf75eb313f161f5
MD5 369aa5632017f46d3a0cb33e0419d999
BLAKE2b-256 9e3c2ff8d74822f5d4680018630af007af6a318fee33502a8958e8f46fb3c72c

See more details on using hashes here.

File details

Details for the file nxv-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nxv-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1025-azure

File hashes

Hashes for nxv-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 964dfb2f9f2c513686707536ba1d0fb3eb0ab82ddc4574982db1b08640bd3083
MD5 ef9df15b9f1e7849dfbea4c26874e390
BLAKE2b-256 4c7363c00709dd5281be547dedc6c9fded488b568ee324bd711e1bed284ccd4d

See more details on using hashes here.

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