New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

netweavex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netweavex

Python package for creating and manipulating graphs and networks

pipPyPI
Version
1.1.2
Weekly downloads
255
Maintainers
1
Weekly downloads
 
Created

NetWeaveX

PyPI version Python versions License

NetWeaveX is a Python library for building, analyzing, and storing graphs and networks.

import netweavex as nx

G = nx.Graph()
G.add_edge("A", "B", weight=4)
G.add_edge("B", "D", weight=2)
G.add_edge("A", "C", weight=3)
G.add_edge("C", "D", weight=4)

print(nx.shortest_path(G, "A", "D", weight="weight"))
# ['A', 'B', 'D']

Installation

pip install netweavex

Python 3.12 or newer is required. Python 3.14.1 is not supported.

The base install has no required third-party dependencies. Install the scientific extras when you want arrays, matrices, data frames, or drawing:

pip install "netweavex[default]"
ExtraIncludes
defaultNumPy, SciPy, Matplotlib, pandas
extralxml, PyGraphviz, pydot, SymPy
testpytest

What you can do

  • Build undirected, directed, and multigraphs, including views and subgraphs.
  • Generate classic, random, lattice, tree, and community graphs.
  • Run shortest paths, centrality, clustering, components, flows, matching, isomorphism, and community detection.
  • Read and write GraphML, GEXF, GML, edge lists, adjacency lists, and JSON.
  • Draw graphs when Matplotlib, Graphviz, or pydot is installed.

Quick start

import netweavex as nx

G = nx.karate_club_graph()

print(G.number_of_nodes(), G.number_of_edges())
print(nx.density(G))
print(sorted(nx.degree_centrality(G), key=nx.degree_centrality(G).get, reverse=True)[:5])

nx.write_graphml(G, "karate.graphml")
H = nx.read_graphml("karate.graphml")

Directed graphs use nx.DiGraph. Multiple edges between the same nodes use nx.MultiGraph or nx.MultiDiGraph.

D = nx.DiGraph([(1, 2), (2, 3), (3, 1)])
print(nx.is_strongly_connected(D))

License

NetWeaveX is released under the 3-clause BSD license. See LICENSE.txt.

Keywords

Networks

FAQs

Related posts