netfog 0.1.0__cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netfog/__init__.py +5 -0
- netfog/__init__.pyi +74 -0
- netfog/netfog.cpython-313t-aarch64-linux-gnu.so +0 -0
- netfog/py.typed +0 -0
- netfog-0.1.0.dist-info/METADATA +61 -0
- netfog-0.1.0.dist-info/RECORD +8 -0
- netfog-0.1.0.dist-info/WHEEL +5 -0
- netfog-0.1.0.dist-info/licenses/LICENSE +21 -0
netfog/__init__.py
ADDED
netfog/__init__.pyi
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
from enum import IntEnum
|
|
3
|
+
|
|
4
|
+
class Layout(IntEnum):
|
|
5
|
+
Random = 0
|
|
6
|
+
Circular = 1
|
|
7
|
+
Spring = 2
|
|
8
|
+
|
|
9
|
+
class GraphStyle:
|
|
10
|
+
node_color: str
|
|
11
|
+
node_border: str
|
|
12
|
+
node_radius: int
|
|
13
|
+
marker_svg: str
|
|
14
|
+
marker_fill: str
|
|
15
|
+
marker_width: int
|
|
16
|
+
marker_height: int
|
|
17
|
+
line_color: str
|
|
18
|
+
line_min_width: int
|
|
19
|
+
line_max_width: int
|
|
20
|
+
dynamic_line_size: bool
|
|
21
|
+
|
|
22
|
+
def __init__(
|
|
23
|
+
self,
|
|
24
|
+
node_color: Optional[str] = None,
|
|
25
|
+
node_border: Optional[str] = None,
|
|
26
|
+
node_radius: Optional[int] = None,
|
|
27
|
+
marker_svg: Optional[str] = None,
|
|
28
|
+
marker_fill: Optional[str] = None,
|
|
29
|
+
marker_width: Optional[int] = None,
|
|
30
|
+
marker_height: Optional[int] = None,
|
|
31
|
+
line_color: Optional[str] = None,
|
|
32
|
+
line_min_width: Optional[int] = None,
|
|
33
|
+
line_max_width: Optional[int] = None,
|
|
34
|
+
dynamic_line_size: Optional[bool] = None,
|
|
35
|
+
) -> None: ...
|
|
36
|
+
|
|
37
|
+
class Graph:
|
|
38
|
+
nodes: list[Node]
|
|
39
|
+
def add_node(self, label: str) -> None: ...
|
|
40
|
+
def create_connection(self, from_label: str, to_label: str, weight: float = 0., directed: bool = False) -> None: ...
|
|
41
|
+
def get_connections(self) -> list: ...
|
|
42
|
+
@staticmethod
|
|
43
|
+
def from_adjacency_matrix(adj_matrix: list, directed: bool = False, custom_labels: list | None = None) -> "Graph": ...
|
|
44
|
+
@staticmethod
|
|
45
|
+
def from_net_file(file_path: str) -> "Graph": ...
|
|
46
|
+
@staticmethod
|
|
47
|
+
def from_json_file(adj_matrix: list) -> "Graph": ...
|
|
48
|
+
def generate_adjacency_matrix(self) -> list: ...
|
|
49
|
+
def get_total_weight(self) -> float: ...
|
|
50
|
+
def get_mean_weight(self) -> float: ...
|
|
51
|
+
def get_node_count(self) -> int: ...
|
|
52
|
+
def get_edge_count(self) -> int: ...
|
|
53
|
+
def get_density(self, directed: bool = False) -> float: ...
|
|
54
|
+
def compute_degrees(self, node_label: str) -> dict: ...
|
|
55
|
+
def get_all_nodes_degrees(self) -> dict: ...
|
|
56
|
+
def get_average_degree(self, directed: bool = False) -> float: ...
|
|
57
|
+
def get_centrality_degree(self, node_label: str) -> dict: ...
|
|
58
|
+
def get_node_stregth(self, node_label: str) -> dict: ...
|
|
59
|
+
def get_degree_distribution(self) -> dict: ...
|
|
60
|
+
def compute_entropy(self) -> dict: ...
|
|
61
|
+
def get_max_possible_entropy(self) -> float: ...
|
|
62
|
+
def get_skewness(self) -> dict: ...
|
|
63
|
+
def dfs(self, start_node_label: str) -> List[str]: ...
|
|
64
|
+
def bfs(self, start_node_label: str) -> List[str]: ...
|
|
65
|
+
def dijkstra(self, start_node_label: str) -> dict: ...
|
|
66
|
+
def output_svg(self, layout: Layout = Layout.Random, override_positions: bool = False, style: Optional[GraphStyle] = None) -> str: ...
|
|
67
|
+
def output_html(self, file_name: str, layout: Layout = Layout.Random, override_positions: bool = False, style: Optional[GraphStyle] = None) -> None: ...
|
|
68
|
+
def output_net_file(self, file_name: str) -> None: ...
|
|
69
|
+
def output_json_file(self, file_name: str) -> None: ...
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class Node:
|
|
73
|
+
label: str
|
|
74
|
+
def add_connection(self, node: "Node", weight: float, directed: bool) -> None: ...
|
|
Binary file
|
netfog/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netfog
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Summary: Python Graph Library
|
|
10
|
+
Author-email: Tiago Fogolin Ragassi <ticofogolin@gmail.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
14
|
+
|
|
15
|
+
# NetFog
|
|
16
|
+
|
|
17
|
+
> [!CAUTION]
|
|
18
|
+
> **Work in Progress:** This library is in its early stages of development (Alpha).
|
|
19
|
+
>
|
|
20
|
+
> * **Unstable API:** Functions and class structures may change significantly between versions.
|
|
21
|
+
> * **Bugs Expected:** You might encounter unexpected behavior. Please feel free to open an issue!
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
**NetFog** is a library for creating and manipulating graphs.
|
|
28
|
+
Currently supports / planned features:
|
|
29
|
+
- Directed and undirected graphs
|
|
30
|
+
- Weighted edges
|
|
31
|
+
- Metrics
|
|
32
|
+
- Algorithms like BFS, DFS, Dijkstra
|
|
33
|
+
- Graph visualization
|
|
34
|
+
- Simulations
|
|
35
|
+
|
|
36
|
+
This library is designed to be **lightweight, fast, and easy to use**.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from netfog import Graph, Node
|
|
44
|
+
|
|
45
|
+
# Creates the graph object
|
|
46
|
+
g = Graph()
|
|
47
|
+
|
|
48
|
+
# Add nodes
|
|
49
|
+
n1 = Node("A")
|
|
50
|
+
n2 = Node("B")
|
|
51
|
+
|
|
52
|
+
# Add a connection (edge or arc)
|
|
53
|
+
# Here we use the label of the nodes for easier manipulation
|
|
54
|
+
g.create_connection("A", "B", weight=10, directed=False)
|
|
55
|
+
|
|
56
|
+
# Check all connections
|
|
57
|
+
print(g.get_connections())
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
For full documentation, see [docs](docs/index.md)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
netfog/__init__.py,sha256=bckvIkjaHY2_NEYvGYD7XooPvKZ7UsKHNq3XwPCavtI,107
|
|
2
|
+
netfog/__init__.pyi,sha256=3lMbNL4hFyQwqhP01FZnDCSIQOW2HGE9iOEqVcIT070,2957
|
|
3
|
+
netfog/netfog.cpython-313t-aarch64-linux-gnu.so,sha256=vCB2yS9hO68D5BQsv5dHuTm02ZG8QAwT7FMNN6o9vBI,1198984
|
|
4
|
+
netfog/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
netfog-0.1.0.dist-info/METADATA,sha256=VrKPdcck8nGw_ySKgCJhgOLo-bOADdqqpiO0dvZb_y4,1515
|
|
6
|
+
netfog-0.1.0.dist-info/WHEEL,sha256=q835leI5tUqUNzGLT6_2V4Cxb6Anw8rRDNKWlUcsVqo,151
|
|
7
|
+
netfog-0.1.0.dist-info/licenses/LICENSE,sha256=AAejHfLFQ9Dd2K4av9txA0wvWtYRgdoUsOVXXrawjlk,1077
|
|
8
|
+
netfog-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tiago Fogolin Ragassi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|