Metadata-Version: 2.4
Name: netweavex
Version: 1.1.1
Summary: Python package for creating and manipulating graphs and networks
License-Expression: BSD-3-Clause
Keywords: Networks,Graph Theory,Mathematics,network,graph,discrete mathematics,math
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: !=3.14.1,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: default
Requires-Dist: numpy>=2.2; extra == "default"
Requires-Dist: scipy>=1.15; extra == "default"
Requires-Dist: matplotlib>=3.10; extra == "default"
Requires-Dist: pandas>=2.3; extra == "default"
Provides-Extra: extra
Requires-Dist: lxml>=4.6; extra == "extra"
Requires-Dist: pygraphviz>=2.0; extra == "extra"
Requires-Dist: pydot>=3.0.1; extra == "extra"
Requires-Dist: sympy>=1.10; extra == "extra"
Provides-Extra: test
Requires-Dist: pytest>=7.2; extra == "test"
Requires-Dist: pytest-cov>=4.0; extra == "test"
Requires-Dist: pytest-xdist>=3.0; extra == "test"
Dynamic: license-file

# NetWeaveX

[![PyPI version](https://img.shields.io/pypi/v/netweavex.svg)](https://pypi.org/project/netweavex/)
[![Python versions](https://img.shields.io/pypi/pyversions/netweavex.svg)](https://pypi.org/project/netweavex/)
[![License](https://img.shields.io/pypi/l/netweavex.svg)](https://pypi.org/project/netweavex/)

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

```python
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

```shell
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:

```shell
pip install "netweavex[default]"
```

| Extra | Includes |
| --- | --- |
| `default` | NumPy, SciPy, Matplotlib, pandas |
| `extra` | lxml, PyGraphviz, pydot, SymPy |
| `test` | pytest |

## 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

```python
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`.

```python
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](LICENSE.txt).
