A Python module that wraps the high-performance `graphrs` Rust library.
Project description
graphrs_python
graphrs_python is a Python wrapper around the high-performance graphrs
Rust crate. See the performance documentation
for a comparison of the performance of graphrs to other graph libraries.
Example Usage
import graphrs_python as grs
nodes = ["n1", "n2", "n3", "n4"]
edges = [("n1", "n2", 1.0), ("n2", "n3", 1.0), ("n3", "n4", 1.0), ("n4", "n2", 1.0)]
graph = grs.create_graph_from_nodes_and_edges(nodes, edges, directed=True)
print(grs.betweenness_centrality(graph, weighted=True, normalized=True))
print(grs.closeness_centrality(graph, weighted=True, wf_improved=True))
print(grs.eigenvector_centrality(graph, weighted=True))
Graphs can also be created from just edges:
import graphrs_python as grs
edges = [("n1", "n2", 1.0), ("n2", "n3", 1.0), ("n3", "n4", 1.0), ("n4", "n2", 1.0)]
graph = grs.create_graph_from_edges(edges, directed=True)
And graphs can also be created from NetworkX Graph objects:
import graphrs_python as grs
import networkx
graph = nx.DiGraph()
graph.add_edges_from(
[
("n1", "n2", {"weight": 1.0}),
("n2", "n3", {"weight": 1.0}),
("n3", "n4", {"weight": 1.0}),
("n4", "n2", {"weight": 1.0}),
]
)
graph = grs.create_graph_from_networkx(graph, weight="weight")
License
MIT
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 Distributions
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 graphrs_python-0.11.0.post1.tar.gz.
File metadata
- Download URL: graphrs_python-0.11.0.post1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d343213bb421af3bf3c26e69a4c76b1f49e24c3ac3b0a6489f4bbc7e158e2e72
|
|
| MD5 |
26f8acb0b61640c087601a71fb2746db
|
|
| BLAKE2b-256 |
51e114a204881977d649bd35663c85749a76fc4676b0016a4d5f0ff9847528ea
|
File details
Details for the file graphrs_python-0.11.0.post1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: graphrs_python-0.11.0.post1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 220.5 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb799fc1a3dbb96d0baf0f09a779ea29ed79b5ee0bcaee0873ac0b07fad2fdc8
|
|
| MD5 |
8d665c84122b12d1d20ba1a96b70a1df
|
|
| BLAKE2b-256 |
b93c0de6bbac52b8444f02b62d29e89635201399ff01c03062e270a3f42613b9
|
File details
Details for the file graphrs_python-0.11.0.post1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: graphrs_python-0.11.0.post1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 373.2 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4c0b221b03b684fb0de07c7440a27affab231d163cb27dcefac21c54a53746e
|
|
| MD5 |
88aacc9e0323979d1620adcc50f4eeb8
|
|
| BLAKE2b-256 |
0c9b4a3c58948a83595e83535f5a0b0555bb8a0a14efd02613ecb9192335fd9c
|
File details
Details for the file graphrs_python-0.11.0.post1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: graphrs_python-0.11.0.post1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 319.2 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
190195e2fa5eab6c96f9a4f1b9cf91ca38ff0d34a01cdcbf5049746d3fdea570
|
|
| MD5 |
d4849100f2b21a68dbe32b457f03db90
|
|
| BLAKE2b-256 |
9298f5c87885352a41fe943d956c32d86a89702f67ce96a076c1a8918986940f
|