Skip to main content

Helios Network (Python)

Python bindings for the Helios Network C core.

Quick start

from helios_network import AttributeScope, AttributeType, Network

network = Network(directed=False)
node_ids = network.add_nodes(3)
network.add_edges([(node_ids[0], node_ids[1])])

network.define_attribute(AttributeScope.Node, "weight", AttributeType.Double, 1)
network.nodes["weight"] = 1.0

# Auto-define attributes on assignment
network.nodes["score"] = 2.5

network.define_attribute(AttributeScope.Network, "title", AttributeType.String, 1)
network.network["title"] = "demo"
print(network.graph["title"])
network["title"] = "demo2"

# Node access
print(network.nodes[node_ids[0]]["weight"])
network.nodes[[node_ids[0], node_ids[1]]]["weight"] = [2.0, 3.0]

for node in network.nodes:
    node["weight"] = 4.0

Selectors

  • network.nodes[id] returns a node view
  • network.nodes[[id1, id2]] returns a selector for active nodes
  • network.nodes["attr"] returns a list of attribute values for active nodes
  • network.nodes["attr"] = value assigns a constant to all active nodes
  • network.nodes[[id1, id2]]["attr"] = [v1, v2] assigns per-node values

Edge access mirrors node access via network.edges, with network.edges.pairs() yielding (source, target) tuples.

For large generated graphs, avoid materializing Python (source, target) tuples:

from array import array

network.add_nodes(1_000_000)
network.add_edges_from_arrays(
    array("I", sources),
    array("I", targets),
)

Network Generators

The Python package exposes native generators as module-level constructors:

from helios_network import generate_watts_strogatz

network = generate_watts_strogatz(
    5_000,
    neighbor_level=2,
    rewiring_probability=0.01,
    seed=1,
)

Available generators include generate_stochastic_block_model, generate_barabasi_albert, generate_watts_strogatz, generate_random_geometric, generate_waxman, generate_configuration_model, and generate_lattice_2d.

Edge indices

for edge_id, (source, target) in network.edges.with_indices():
    print(edge_id, source, target)

Measurements and Community Detection

The Python wrapper exposes the native measurement APIs:

degree = network.measure_degree(direction="both")
components = network.measure_connected_components(mode="weak")
leiden = network.leiden_modularity(
    resolution=1.0,
    seed=42,
    out_node_community_attribute="community",
)

leiden_modularity(...) is an alias for measure_leiden_modularity(...). It writes an unsigned-integer node attribute and returns community_count, modularity, and values_by_node.

To label only major components for filtering or visualization:

major = network.label_major_components(
    mode="weak",
    max_components=3,
    min_size=100,
    out_node_component_attribute="major_component",
)

Selected components receive rank labels 1..N by decreasing size. Other nodes receive 0 by default.

The Leiden comparison harness in research/benchmarks/leiden_compare/ uses a conda environment file:

conda env create -f research/benchmarks/leiden_compare/environment.yml
conda run -n helios-leiden-compare python -m pip install -e python --no-build-isolation
conda run -n helios-leiden-compare python research/benchmarks/leiden_compare/compare_leiden.py

Installation

Standard install:

python -m pip install ./python --upgrade

Editable install (recommended during development):

python -m pip install -e python --no-build-isolation

mesonpy editable builds require --no-build-isolation.

If editable install fails, install build tools in the active environment:

python -m pip install meson ninja meson-python
python -m pip install -e python --no-build-isolation

Optional conversions

NetworkX and igraph conversions are optional. Install when needed:

python -m pip install networkx
python -m pip install igraph

UMAP export

Install the optional UMAP stack when you want a Helios-ready fuzzy graph or kNN graph export:

python -m pip install ./python[umap]
from helios_network import HeliosUMAP

umap_export = HeliosUMAP(
    n_neighbors=15,
    min_dist=0.1,
    build_knn_network=True,
)

network = umap_export.fit_network(X)
network.save_bxnet("embedding.bxnet")

# Optional directed kNN export
umap_export.knn_network_.save_zxnet("embedding-knn.zxnet")

If you want only the UMAP graph construction output for helios-web-next to lay out from scratch, use the graph-only export path instead:

graph_network = umap_export.fit_graph_network(X)
graph_network.save_zxnet("umap-graph.zxnet")

The fit graph export writes:

  • node attributes: umap_embedding, _helios_visuals_position, umap_mass
  • edge attribute: umap_weight
  • network attributes that let helios-web-next auto-enable UMAP force mode on import

The graph-only export writes the same UMAP edge weights and graph metadata, but omits umap_embedding and _helios_visuals_position so helios-web-next can start its own realtime UMAP-like layout from scratch.

Examples

From python/:

python examples/basic_usage.py
python examples/toroidal_dimensions_table.py
python examples/toroidal_dimensions_plot.py --skip-plot
python examples/toroidal_dimensions_plot.py
python examples/toroidal_dimensions_plot.py --large --skip-plot
python examples/generate_umap_example_networks.py --sizes 200 2000 20000

toroidal_dimensions_plot.py uses matplotlib for plotting local dimension curves. Install it with:

python -m pip install matplotlib

Vector attributes

Attributes with dimension > 1 accept vector assignments:

network.define_attribute(AttributeScope.Node, "i3", AttributeType.Integer, 3)
network.nodes["i3"] = [1, 2, 3]  # broadcast to all nodes
network.nodes[[0, 1]]["i3"] = [[4, 5, 6], [7, 8, 9]]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helios_network-0.10.4.tar.gz (1.8 MB view details)

Uploaded Source

Built Distributions

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

helios_network-0.10.4-cp313-cp313-win_amd64.whl (504.1 kB view details)

Uploaded CPython 3.13Windows x86-64

helios_network-0.10.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (366.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

helios_network-0.10.4-cp313-cp313-macosx_11_0_arm64.whl (278.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

helios_network-0.10.4-cp312-cp312-win_amd64.whl (504.1 kB view details)

Uploaded CPython 3.12Windows x86-64

helios_network-0.10.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (367.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

helios_network-0.10.4-cp312-cp312-macosx_11_0_arm64.whl (278.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

helios_network-0.10.4-cp311-cp311-win_amd64.whl (503.8 kB view details)

Uploaded CPython 3.11Windows x86-64

helios_network-0.10.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (366.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

helios_network-0.10.4-cp311-cp311-macosx_11_0_arm64.whl (278.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

helios_network-0.10.4-cp310-cp310-win_amd64.whl (503.8 kB view details)

Uploaded CPython 3.10Windows x86-64

helios_network-0.10.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (366.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

helios_network-0.10.4-cp310-cp310-macosx_11_0_arm64.whl (278.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

helios_network-0.10.4-cp39-cp39-win_amd64.whl (504.5 kB view details)

Uploaded CPython 3.9Windows x86-64

helios_network-0.10.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (366.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

helios_network-0.10.4-cp39-cp39-macosx_11_0_arm64.whl (278.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file helios_network-0.10.4.tar.gz.

File metadata

  • Download URL: helios_network-0.10.4.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for helios_network-0.10.4.tar.gz
Algorithm Hash digest
SHA256 6da1ba7c516da6bae26b96474983057eaa6a5122c8d474ba382b1189c9ec897e
MD5 77aff79a8808938eaabf6c0e2056f777
BLAKE2b-256 0097c33c5980f927382f946a74f295db4f98fe958654f25b897a27cfbb25d03c

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4.tar.gz:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d62e4620e5f377741bf26004251ab64b8c2ccc63561e6ee9a044b4d6539b2421
MD5 64683a24f18d8ec05f15b82d3a55823d
BLAKE2b-256 1e0da534bbaace5422fa3cee9ed54ad4c5639dbc2d00dbe1c68a6e534d15938e

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp313-cp313-win_amd64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3875a3c6888711ecfaddb56ff8e248d7a39f942f4568883174d48cce5bf9c20
MD5 d04a5813d21ca3c458ac4044881f9ea2
BLAKE2b-256 d05a6bab6c79e45cc408cd44326a49f0ec050f15578d674b8fdd23d911bd0af2

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 130ab011dd49c345537b1f34ec0cef05074507e02f67abd06a7ade0aa7ea0a3a
MD5 062ac6705a4f6e782c5f2fe6b64ce1e0
BLAKE2b-256 cbd0c3e3aff200d971b16da594deb1c706b4e8b2d34e7b94b8eba852e4604c69

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 17329d48acd236008704994bb103878ab21a72962c6f432710be4c08b28c5d2b
MD5 fd9fe4145818b69bd185d52daf7b04d5
BLAKE2b-256 3641616586f88e4999c2debc0b0c64c898a4eb69fa9d1ad09f780c48085b48cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp312-cp312-win_amd64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac0b55652d671c9700f4a8eb2f3206d7fd7d6ac55c000dbf8f8f8477112d6c9c
MD5 e7580236f799be5b464093db15686425
BLAKE2b-256 17990a298054f413c8da2c14d226b09bc8d990c811edfd93bb81e584d3699140

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3222987523127529acc2375a68e910e4084c4f179b5eae232dfb244fc76fcb67
MD5 899dc3d0a214c190a2bc884f0fece6fe
BLAKE2b-256 13a1cbf465db23cf06d84d1a2705d5ddca711f74d36c3b073006feead1d44299

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7ac6a859c294ac3aaae846f37f076aacff9e24b741578c7bedbc10f5b6213d83
MD5 852747550551f7beb381d14c675208c2
BLAKE2b-256 753096460a56c90449681b7b5f791bf10e1898a519b65da0c0f4b49ec44ead33

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp311-cp311-win_amd64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 41d13037af8f3722128c4eda287a8af393a265a7064f4652ada894f59517923c
MD5 38a0aecd91b72ae9e8e28d81a1bf5955
BLAKE2b-256 49d0ebc24d046bb9e007a76d3f755e136c23ef0b9b6aa34400aa2fd04168540a

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28af3dd9a5393cbdba8c61f4bf109ce15d3f309a3930b5b4b7776218c2e63861
MD5 c2b60c643f59c732df435a6a66dc818b
BLAKE2b-256 7384398d9d0ac79c69af494f11307bf59c9b6db9d61fe19e05a2c7e903c9b138

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 13da043aacd2b160a983ee879ec17211dda9c71a44ebb6a1ce61d689be9fd044
MD5 f9109c8e437d00e8b12d44916c608a12
BLAKE2b-256 dd439a30c1b9865425327cb6998fdbc52ed78bbe4c27660fb61e12e8532c816d

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp310-cp310-win_amd64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 490ba4763bc2d3b29c8cc45acae033381b00c909d038cd446222d97528a5d419
MD5 081eac3ae3582775647a6de8a0ebf102
BLAKE2b-256 6e1a3ba452c4e34f6032c7295ec5e0c696468d098f2fa29b895a4982518e6957

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 218c6e74a3fe0fab282dde376b86c5912844d5fbadc2158e3d2b7e4f5ce53ac0
MD5 c35c123daca97a7355e6e8f691a55418
BLAKE2b-256 e318db26842f831b8cdaaa32314ebd5757b0df787a5ba0acc7444e4cfff1323a

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 319d61febf7ada305ce4fa62baeb27428445df608f037711f0728501d33657d6
MD5 fe24779f915a109ac9e0db4c92cd9bdf
BLAKE2b-256 5f872effcdf4eaa8ea09261c1a2867c33f1b004e9b7c8cee54fafda5bd089edd

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp39-cp39-win_amd64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6f5d147f84fdb5cdc165367f927b202fdd19be361f3542c40b70af2f4f853793
MD5 63211782af82a0d16a669a79a48e8333
BLAKE2b-256 2fbb6ff62651278cb92a7e3d5f3c708f7f29c4adc831d7a5d9d95dd5dbee93c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helios_network-0.10.4-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helios_network-0.10.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e10bf1c3bfe64cfb55dd06a0bf6a60dd1f57390a829dcc3b171d379649a96e14
MD5 37d3f24605d14f3ba36f964a256a6637
BLAKE2b-256 d337aed22dedd50738844542b784244d7d0e94d0461bb8f55bc75fb7eb115007

See more details on using hashes here.

Provenance

The following attestation bundles were made for helios_network-0.10.4-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: release.yml on filipinascimento/helios-network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.10.4 This release

16 files

0.10.3

16 files

0.10.2

16 files

0.10.1

16 files

Supported by

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