See the wiki
First, pip install graphworks
import json
from src.graphworks.graph import Graph
json_graph = {"label": "my graph", "edges": {"A": ["B"], "B": []}}
graph = Graph("my graph", input_graph=json.dumps(json_graph))
print(graph)- Python 3.8+
- virtualenv
- numpy
- graphviz
pip install virtualenv
virtualenv envsource ./env/bin/activatedeactivatepip install -r requirements.txt- Update the version number in
graphworks.__init__.py - Run
python -m build - Run
twine check dist/* - Upload to test PyPi:
twine upload --repository-url https://test.pypi.org/legacy/ dist/* - Upload to PyPi main:
twine upload --skip-existing dist/* - To autopublish, tag commit with
git tag -a vX.Y.Z -m 'release message - Then
git push --tags
- Run the unit tests:
python -m unittest discover tests '*_tests.py' - Run unit test coverage:
coverage run --source=graphworks/ -m unittest discover tests '*_tests.py' - Generate test coverage reports (either works):
coverage report --omit="*/test*,*/venv/*"coverage html --omit="*/test*,*/venv/*"
- Create Vertex class
- https://www.python-course.eu/graphs_python.php
- Build out directed graphs algorithms
- Allow for weighted graph algorithms
- Jarnik's algorithm
- Dijkstra's algorithm
- C++ binaries for speeding up graph computations