An efficient Mojo implementation of a subset of NetworkX (Graph/DiGraph, algorithms, and attributes).
Project description
networkx-mojo
An efficient Mojo implementation of a subset of the Python NetworkX API.
Requirements
- Mojo (installed into a local
.venvviauv)
Install Mojo (via uv)
Follow the official install docs for your platform.
Nightly (recommended for development):
uv venv
. .venv/bin/activate
uv pip install mojo --index https://whl.modular.com/nightly/simple/ --prerelease allow
Stable:
uv venv
. .venv/bin/activate
uv pip install mojo --extra-index-url https://modular.gateway.scarf.sh/simple/
Run tests
.venv/bin/mojo run -I . tests/test_graph.mojo
.venv/bin/mojo run -I . tests/test_digraph.mojo
.venv/bin/mojo run -I . tests/test_algorithms.mojo
.venv/bin/mojo run -I . tests/test_attrs.mojo
.venv/bin/mojo run -I . tests/test_more_algorithms.mojo
Benchmarks
.venv/bin/mojo run -I . benches/graph_bench.mojo
Examples
Grid pathfinding + visualization:
.venv/bin/mojo run -I . examples/grid_pathfinding.mojo
If you're using uv run, make sure you invoke mojo run with -I . so Mojo can
resolve local modules (like networkx):
uv run mojo run -I . examples/grid_pathfinding.mojo
The visualization script requires the optional dependencies:
uv pip install -e '.[bench]'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file networkx_mojo-0.1.0.tar.gz.
File metadata
- Download URL: networkx_mojo-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a9956139c32cbfcda7ce9a6385983aad463c4772aaa68e11a83d041a3f59ba9
|
|
| MD5 |
fd0d367d9f83b66f9484d6ae6bf39bde
|
|
| BLAKE2b-256 |
2209913547604fd337a4c48464ffd7bc5e8212ee3fb967c57331bbf9cc2b2805
|
File details
Details for the file networkx_mojo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: networkx_mojo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51fcf1ba4f86c844cd37dc2bf00d775858dc95617b81feaeddf708d8c74189f6
|
|
| MD5 |
fe1ce56c5cbae00b0a2a0b7051aeeab5
|
|
| BLAKE2b-256 |
f24b7304e6c532defebe2f71b0978d12159c729cb80649054f7fb73cb8337d41
|