Metadata-Version: 2.1
Name: abcd-graph
Version: 0.1.1
Summary: 
License: MIT
Author: Your Name
Author-email: you@example.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: all
Provides-Extra: dev
Provides-Extra: igraph
Provides-Extra: matplotlib
Provides-Extra: networkx
Requires-Dist: igraph; extra == "igraph" or extra == "all"
Requires-Dist: matplotlib (>=3.9.0,<4.0.0); extra == "matplotlib" or extra == "all"
Requires-Dist: networkx (>=3.3,<4.0); extra == "networkx" or extra == "all"
Requires-Dist: numpy (>=1.26.4,<2.0.0)
Requires-Dist: pre-commit (>=3.7.0,<4.0.0); extra == "dev" or extra == "all"
Requires-Dist: pydantic (>=2.6.4,<3.0.0)
Requires-Dist: pytest (>=8.1.1,<9.0.0); extra == "dev" or extra == "all"
Requires-Dist: pytest-cov (>=5.0.0,<6.0.0); extra == "dev" or extra == "all"
Requires-Dist: typing-extensions (>=4.10.0,<5.0.0)
Description-Content-Type: text/markdown

# abcd-graph
A python library for generating ABCD graphs.

## Installation
```bash
pip install abcd-graph
```

## Usage
```python
from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build()
```

### Parameters

- `params`: An instance of `ABCDParams` class.
- `n`: Number of nodes in the graph.
- `logger` A boolean to enable or disable logging to the console. Default is `False` - no logs are shown.


### Exporting

The graph object can be exported to `networkx.Graph` object using the `to_networkx` method.

```python
from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().to_networkx()
```

This requires the `networkx` library to be installed.
```bash
pip install abcd-graph[networkx]
```

Another option is an `igraph.Graph` object.

```python
from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().to_igraph()
```

This requires the `igraph` library to be installed.
```bash
pip install abcd-graph[igraph]
```

Finally, the graph can be exported to a `numpy.ndarray` object that represents the `adjacency matrix`.

```python
from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().adj_matrix
```

> [!IMPORTANT]
> If the `build()` method is not run before calling any of the export methods, a `RuntimeError` will be raised.

> [!NOTE]
> The `numpy` array is of type `numpy.bool_`. If the graph was not properly generated (loops or multi-edges),
> a `MalformedGraphError` will be raised.

