Skip to main content

Create D3 visualization networks with Python

Project description

PyNetworkD3

Create D3 visualization networks with Python

PyPI - Version Tests Linters

Installation

Install using pip!

$ pip install pynetworkd3

Usage

To use the library, import the Graph object directly and use the export method to create a .html with the visualization.

from PyNetworkD3 import Graph

dataset = {
    "nodes": [{"id": 1},{"id": 2},{"id": 3},{"id": 4},{"id": 5}],
    "links": [
        {"source": 1, "target": 3},
        {"source": 2, "target": 3},
        {"source": 1, "target": 3},
        {"source": 5, "target": 3},
        {"source": 4, "target": 1},
    ]
}

graph = Graph(dataset, width=300, height=200, radio=10, tooltip=["id"])

graph.export("output.html)

Also you can write the instance in the last line of the notebook's cell (view the example in colab) to view the visualization.

Developing

This library uses PyTest as the test suite runner, and PyLint, Flake8, Black, ISort and MyPy as linters. It also uses Poetry as the default package manager.

The library includes a Makefile that has every command you need to start developing. If you don't have it, install Poetry using:

make get-poetry

Then, create a virtualenv to use throughout the development process, using:

make build-env

Activate the virtualenv using:

. .venv/bin/activate

Deactivate it using:

deactivate

To add a new package, use Poetry:

poetry add <new-package>

To run the linters, you can use:

# The following commands auto-fix the code
make black!
make isort!

# The following commands just review the code
make black
make isort
make flake8
make mypy
make pylint

To run the tests, you can use:

make tests

Releasing

To make a new release of the library, git switch to the master branch and execute:

make bump! minor

The word minor can be replaced with patch or major, depending on the type of release. The bump! command will bump the versions of the library, create a new branch, add and commit the changes. Then, just merge that branch to master. Finally, execute a merge to the stable branch. Make sure to update the version before merging into stable, as PyPi will reject packages with duplicated versions.

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

PyNetworkD3-0.0.7.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyNetworkD3-0.0.7-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file PyNetworkD3-0.0.7.tar.gz.

File metadata

  • Download URL: PyNetworkD3-0.0.7.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for PyNetworkD3-0.0.7.tar.gz
Algorithm Hash digest
SHA256 42919a3cce31de0467b5c6c958affe22427e79c98a9ac0db7433708a829ad048
MD5 a46e4d60ee1bdeec079130eaa33371dc
BLAKE2b-256 2bc255e1de213c556d46532ce792deb61c407dca6122d0f2d49715526e386523

See more details on using hashes here.

File details

Details for the file PyNetworkD3-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: PyNetworkD3-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for PyNetworkD3-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f8d977e4f332f963a0b076e617151a50e28d7426fbd71152b5d7d88f20be763d
MD5 bc5918eb83e33461c30a65147215c4d6
BLAKE2b-256 31ba038e9d12f2745343417c87c29999da425d60ab7b909cd1a1bd5e68400b9a

See more details on using hashes here.

Supported by

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