topolib 0.4.1__tar.gz → 0.5.0__tar.gz

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.

Potentially problematic release.


This version of topolib might be problematic. Click here for more details.

Files changed (49) hide show
  1. {topolib-0.4.1 → topolib-0.5.0}/PKG-INFO +42 -59
  2. topolib-0.5.0/README.md +87 -0
  3. {topolib-0.4.1 → topolib-0.5.0}/pyproject.toml +7 -1
  4. {topolib-0.4.1 → topolib-0.5.0}/topolib/analysis/metrics.py +6 -6
  5. topolib-0.5.0/topolib/assets/AMRES.json +1265 -0
  6. topolib-0.5.0/topolib/assets/Bell_canada.json +925 -0
  7. topolib-0.5.0/topolib/assets/Brazil.json +699 -0
  8. topolib-0.5.0/topolib/assets/CESNET.json +657 -0
  9. topolib-0.5.0/topolib/assets/CORONET.json +1957 -0
  10. topolib-0.4.1/topolib/assets/China_pop.json → topolib-0.5.0/topolib/assets/China.json +109 -37
  11. topolib-0.5.0/topolib/assets/DT-14.json +470 -0
  12. topolib-0.5.0/topolib/assets/DT-17.json +525 -0
  13. topolib-0.4.1/topolib/assets/DT-50_pop.json → topolib-0.5.0/topolib/assets/DT-50.json +165 -65
  14. topolib-0.5.0/topolib/assets/ES-30.json +967 -0
  15. topolib-0.5.0/topolib/assets/EURO-16.json +455 -0
  16. topolib-0.5.0/topolib/assets/FR-43.json +1277 -0
  17. topolib-0.5.0/topolib/assets/FUNET.json +317 -0
  18. topolib-0.5.0/topolib/assets/GCN-BG.json +855 -0
  19. topolib-0.5.0/topolib/assets/GRNET.json +1717 -0
  20. topolib-0.5.0/topolib/assets/HyperOne.json +255 -0
  21. topolib-0.5.0/topolib/assets/IT-21.json +649 -0
  22. topolib-0.5.0/topolib/assets/India.json +517 -0
  23. topolib-0.5.0/topolib/assets/JPN-12.json +331 -0
  24. topolib-0.5.0/topolib/assets/KOREN.json +287 -0
  25. topolib-0.5.0/topolib/assets/NORDUNet.json +783 -0
  26. topolib-0.5.0/topolib/assets/NSFNet.json +399 -0
  27. topolib-0.5.0/topolib/assets/PANEURO.json +757 -0
  28. topolib-0.5.0/topolib/assets/PAVLOV.json +465 -0
  29. topolib-0.5.0/topolib/assets/PLN-12.json +343 -0
  30. topolib-0.5.0/topolib/assets/SANReN.json +161 -0
  31. topolib-0.5.0/topolib/assets/SERBIA-MONTENEGRO.json +139 -0
  32. topolib-0.5.0/topolib/assets/Telefonica-21.json +637 -0
  33. topolib-0.5.0/topolib/assets/Turk_Telekom.json +551 -0
  34. topolib-0.5.0/topolib/assets/UKNet.json +685 -0
  35. topolib-0.5.0/topolib/assets/Vega_Telecom.json +819 -0
  36. topolib-0.5.0/topolib/topology/topology.py +417 -0
  37. topolib-0.4.1/README.md +0 -105
  38. topolib-0.4.1/topolib/topology/topology.py +0 -172
  39. {topolib-0.4.1 → topolib-0.5.0}/LICENSE +0 -0
  40. {topolib-0.4.1 → topolib-0.5.0}/topolib/__init__.py +0 -0
  41. {topolib-0.4.1 → topolib-0.5.0}/topolib/analysis/__init__.py +0 -0
  42. /topolib-0.4.1/topolib/assets/Abilene_IXP.json → /topolib-0.5.0/topolib/assets/Abilene.json +0 -0
  43. {topolib-0.4.1 → topolib-0.5.0}/topolib/elements/__init__.py +0 -0
  44. {topolib-0.4.1 → topolib-0.5.0}/topolib/elements/link.py +0 -0
  45. {topolib-0.4.1 → topolib-0.5.0}/topolib/elements/node.py +0 -0
  46. {topolib-0.4.1 → topolib-0.5.0}/topolib/topology/__init__.py +0 -0
  47. {topolib-0.4.1 → topolib-0.5.0}/topolib/topology/path.py +0 -0
  48. {topolib-0.4.1 → topolib-0.5.0}/topolib/visualization/__init__.py +0 -0
  49. {topolib-0.4.1 → topolib-0.5.0}/topolib/visualization/mapview.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topolib
3
- Version: 0.4.1
3
+ Version: 0.5.0
4
4
  Summary: A compact Python library for modeling, analyzing, and visualizing optical network topologies.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -21,6 +21,7 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Requires-Dist: contextily
23
23
  Requires-Dist: geopandas
24
+ Requires-Dist: jsonschema (>=4.0)
24
25
  Requires-Dist: matplotlib
25
26
  Requires-Dist: networkx (>=2.6)
26
27
  Requires-Dist: numpy (>=1.21)
@@ -31,7 +32,7 @@ Project-URL: Repository, https://gitlab.com/DaniloBorquez/topolib
31
32
  Description-Content-Type: text/markdown
32
33
 
33
34
  # Topolib 🚀
34
-
35
+ # Topolib 🚀
35
36
 
36
37
  [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
37
38
  [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
@@ -40,99 +41,81 @@ Description-Content-Type: text/markdown
40
41
  [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
41
42
  [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
42
43
 
43
- A compact Python library for working with optical network topologies: nodes, links, metrics and visualization tools. 🌐
44
+ > **Topolib** is a compact, modular Python library for modeling, analyzing, and visualizing optical network topologies.
45
+ > **Goal:** Provide researchers and engineers with a simple, extensible toolkit for working with nodes, links, metrics, and map-based visualizations.
46
+ >
47
+ > 🌐 **Model** | 📊 **Analyze** | 🗺️ **Visualize** | 🧩 **Extend**
48
+
49
+ ---
44
50
 
45
- ## Overview
51
+ ## 📂 Examples
46
52
 
47
- Topolib models network topologies with three main modules:
53
+ Explore ready-to-run usage examples in the [`examples/`](examples/) folder!
54
+ - [Show topology on a map](examples/show_topology_in_map.py) 🗺️
55
+ - [Export topology to CSV and JSON](examples/export_csv_json.py) 📄
56
+ - [Export topology and k-shortest paths for FlexNetSim](examples/export_flexnetsim.py) 🔀
48
57
 
49
- - `topolib.elements` — Definitions of elementary building blocks
50
- - `Node` — represents a network node with id, name and geographic coordinates
51
- - `Link` — connects two `Node` objects and stores link length and id
58
+ ---
52
59
 
53
- - `topolib.topology` — High-level topology model
54
- - `Topology` — holds nodes and links, provides methods to add/remove nodes and links, compute metrics, export JSON, and compute shortest/disjoint paths
55
- - `Path` — represents a path through the topology
60
+ ## 🧭 Overview
56
61
 
57
- - `topolib.analysis` Metrics and analysis helpers
58
- - `Metrics` — functions to compute node degree, link length statistics, connection matrices, etc.
62
+ Topolib is organized into four main modules:
59
63
 
60
- - `topolib.visualization` — Visualization helpers
61
- - `MapView` — functions to display topology with OSM or paper-style maps
64
+ - 🧱 **Elements:** `Node`, `Link`basic building blocks
65
+ - 🕸️ **Topology:** `Topology`, `Path`manage nodes, links, paths, and adjacency
66
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
67
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
62
68
 
63
- (These components are derived from the project's class diagram in `diagrams/class_diagram.puml`.)
69
+ ---
64
70
 
65
- ## Features
66
- - Modular design: elements, topology, analysis, and visualization
71
+ ## Features
72
+
73
+ - Modular, extensible design
67
74
  - Easy-to-use classes for nodes, links, and paths
68
75
  - Built-in metrics and analysis helpers
69
76
  - JSON import/export and interoperability
70
77
  - Ready for Sphinx, Read the Docs, and PyPI
71
78
 
72
- ## Quickstart ⚡
79
+ ---
73
80
 
74
- Create and activate a virtual environment, install dev dependencies and run tests:
81
+ ## Quickstart
75
82
 
76
83
  ```bash
77
84
  python -m venv .venv
78
85
  source .venv/bin/activate
79
- python -m pip install -U pip
80
- python -m pip install -r dev-requirements.txt
81
- python -m pytest -q
82
- ```
83
-
84
- ## Installation
85
-
86
- ```bash
86
+ pip install -U pip
87
87
  pip install topolib
88
88
  ```
89
89
 
90
- Or for development:
90
+ ---
91
91
 
92
- ```bash
93
- git clone https://gitlab.com/DaniloBorquez/topolib.git
94
- cd topolib
95
- python -m venv .venv
96
- source .venv/bin/activate
97
- pip install -e .
98
- pip install -r dev-requirements.txt
99
- ```
100
-
101
- ## Documentation
92
+ ## 📚 Documentation
102
93
 
103
94
  Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
104
95
 
105
- ## Basic usage example
96
+ ---
106
97
 
107
- ```py
98
+ ## 📝 Basic usage
99
+
100
+ ```python
108
101
  from topolib.elements.node import Node
109
102
  from topolib.topology.topology import Topology
110
103
 
111
- # Create nodes
112
104
  n1 = Node(1, 'A', 10.0, 20.0)
113
105
  n2 = Node(2, 'B', 11.0, 21.0)
114
-
115
- # Build topology
116
- topo = Topology()
117
- topo.add_node(n1)
118
- topo.add_node(n2)
119
- # add links, compute metrics, visualize
106
+ topo = Topology(nodes=[n1, n2])
107
+ # Add links, compute metrics, visualize, etc.
120
108
  ```
121
109
 
110
+ ---
122
111
 
123
- ## Development 🛠️
124
-
125
- See `CONTRIBUTING.md` for development guidelines, commit message rules and pre-commit setup.
126
-
127
-
128
-
129
- ## Class diagram
112
+ ## 🛠️ Development
130
113
 
131
- ![](diagrams/class_diagram.puml)
114
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
132
115
 
133
- (If you prefer a rendered image of the UML, render the PlantUML file locally or in your CI pipeline.)
116
+ ---
134
117
 
135
- ## License
118
+ ## 📄 License
136
119
 
137
- See `LICENSE` in the project root.
120
+ MIT — see [`LICENSE`](LICENSE) for details.
138
121
 
@@ -0,0 +1,87 @@
1
+ # Topolib 🚀
2
+ # Topolib 🚀
3
+
4
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
5
+ [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
6
+ [![Issues](https://img.shields.io/badge/issues-on%20GitLab-blue.svg)](https://gitlab.com/DaniloBorquez/topolib/-/issues)
7
+ [![Develop coverage](https://gitlab.com/DaniloBorquez/topolib/badges/develop/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=develop)
8
+ [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
9
+ [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
10
+
11
+ > **Topolib** is a compact, modular Python library for modeling, analyzing, and visualizing optical network topologies.
12
+ > **Goal:** Provide researchers and engineers with a simple, extensible toolkit for working with nodes, links, metrics, and map-based visualizations.
13
+ >
14
+ > 🌐 **Model** | 📊 **Analyze** | 🗺️ **Visualize** | 🧩 **Extend**
15
+
16
+ ---
17
+
18
+ ## 📂 Examples
19
+
20
+ Explore ready-to-run usage examples in the [`examples/`](examples/) folder!
21
+ - [Show topology on a map](examples/show_topology_in_map.py) 🗺️
22
+ - [Export topology to CSV and JSON](examples/export_csv_json.py) 📄
23
+ - [Export topology and k-shortest paths for FlexNetSim](examples/export_flexnetsim.py) 🔀
24
+
25
+ ---
26
+
27
+ ## 🧭 Overview
28
+
29
+ Topolib is organized into four main modules:
30
+
31
+ - 🧱 **Elements:** `Node`, `Link` — basic building blocks
32
+ - 🕸️ **Topology:** `Topology`, `Path` — manage nodes, links, paths, and adjacency
33
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
34
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
35
+
36
+ ---
37
+
38
+ ## ✨ Features
39
+
40
+ - Modular, extensible design
41
+ - Easy-to-use classes for nodes, links, and paths
42
+ - Built-in metrics and analysis helpers
43
+ - JSON import/export and interoperability
44
+ - Ready for Sphinx, Read the Docs, and PyPI
45
+
46
+ ---
47
+
48
+ ## ⚡ Quickstart
49
+
50
+ ```bash
51
+ python -m venv .venv
52
+ source .venv/bin/activate
53
+ pip install -U pip
54
+ pip install topolib
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 📚 Documentation
60
+
61
+ Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
62
+
63
+ ---
64
+
65
+ ## 📝 Basic usage
66
+
67
+ ```python
68
+ from topolib.elements.node import Node
69
+ from topolib.topology.topology import Topology
70
+
71
+ n1 = Node(1, 'A', 10.0, 20.0)
72
+ n2 = Node(2, 'B', 11.0, 21.0)
73
+ topo = Topology(nodes=[n1, n2])
74
+ # Add links, compute metrics, visualize, etc.
75
+ ```
76
+
77
+ ---
78
+
79
+ ## 🛠️ Development
80
+
81
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
82
+
83
+ ---
84
+
85
+ ## 📄 License
86
+
87
+ MIT — see [`LICENSE`](LICENSE) for details.
@@ -2,7 +2,7 @@
2
2
  [tool.poetry]
3
3
  name = "topolib"
4
4
  # Poetry requires a version field, but poetry-dynamic-versioning will override it
5
- version = "0.4.1"
5
+ version = "0.5.0"
6
6
  description = "A compact Python library for modeling, analyzing, and visualizing optical network topologies."
7
7
  authors = ["Danilo Bórquez-Paredes <danilo.borquez.p@uai.cl>"]
8
8
  license = "MIT"
@@ -30,6 +30,9 @@ matplotlib = "*"
30
30
  contextily = "*"
31
31
  geopandas = "*"
32
32
  shapely = "*"
33
+ jsonschema = ">=4.0"
34
+
35
+ ## Ensures interactive backend for matplotlib
33
36
 
34
37
 
35
38
  [tool.poetry.group.dev.dependencies]
@@ -39,6 +42,9 @@ matplotlib = "*"
39
42
  contextily = "*"
40
43
  geopandas = "*"
41
44
  shapely = "*"
45
+ jsonschema = ">=4.0"
46
+
47
+ ## Ensures interactive backend for matplotlib in development
42
48
 
43
49
  [build-system]
44
50
  requires = ["poetry-core>=1.0.0"]
@@ -2,7 +2,7 @@
2
2
  Metrics module for network topology analysis.
3
3
  """
4
4
 
5
- from typing import List, Any, Dict, Optional
5
+ from typing import List, Dict, Optional
6
6
 
7
7
 
8
8
  from topolib.topology import Topology
@@ -12,16 +12,16 @@ class Metrics:
12
12
  """
13
13
  Provides static methods for computing metrics on network topologies.
14
14
 
15
- Todos los métodos reciben una instancia de Topology.
15
+ All methods receive a Topology instance.
16
16
 
17
- Métodos
17
+ Methods
18
18
  -------
19
19
  node_degree(topology)
20
- Calcula el grado de cada nodo.
20
+ Calculates the degree of each node.
21
21
  link_length_stats(topology)
22
- Calcula estadísticas (min, max, avg) de las longitudes de los enlaces.
22
+ Calculates statistics (min, max, avg) of link lengths.
23
23
  connection_matrix(topology)
24
- Construye la matriz de adyacencia.
24
+ Builds the adjacency matrix.
25
25
  """
26
26
 
27
27
  @staticmethod