topolib 0.3.0__tar.gz → 0.4.2__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.2/PKG-INFO +119 -0
  2. topolib-0.4.2/README.md +86 -0
  3. topolib-0.4.2/pyproject.toml +52 -0
  4. topolib-0.4.2/topolib/__init__.py +4 -0
  5. {topolib-0.3.0 → topolib-0.4.2}/topolib/analysis/metrics.py +6 -6
  6. topolib-0.4.2/topolib/assets/Abilene_IXP.json +285 -0
  7. topolib-0.4.2/topolib/assets/China_pop.json +1063 -0
  8. topolib-0.4.2/topolib/assets/DT-50_pop.json +1415 -0
  9. {topolib-0.3.0 → topolib-0.4.2}/topolib/elements/node.py +103 -1
  10. {topolib-0.3.0 → topolib-0.4.2}/topolib/topology/topology.py +54 -8
  11. topolib-0.4.2/topolib/visualization/__init__.py +1 -0
  12. topolib-0.4.2/topolib/visualization/mapview.py +75 -0
  13. topolib-0.3.0/MANIFEST.in +0 -5
  14. topolib-0.3.0/PKG-INFO +0 -127
  15. topolib-0.3.0/README.md +0 -105
  16. topolib-0.3.0/diagrams/class_diagram.puml +0 -75
  17. topolib-0.3.0/docs/source/conf.py +0 -37
  18. topolib-0.3.0/docs/source/index.rst +0 -33
  19. topolib-0.3.0/docs/source/modules.rst +0 -7
  20. topolib-0.3.0/docs/source/topolib.analysis.rst +0 -21
  21. topolib-0.3.0/docs/source/topolib.elements.rst +0 -23
  22. topolib-0.3.0/docs/source/topolib.rst +0 -20
  23. topolib-0.3.0/docs/source/topolib.topology.rst +0 -29
  24. topolib-0.3.0/pyproject.toml +0 -37
  25. topolib-0.3.0/setup.cfg +0 -4
  26. topolib-0.3.0/tests/test_link.py +0 -77
  27. topolib-0.3.0/tests/test_metrics.py +0 -53
  28. topolib-0.3.0/tests/test_node.py +0 -28
  29. topolib-0.3.0/tests/test_path.py +0 -46
  30. topolib-0.3.0/tests/test_topology.py +0 -144
  31. topolib-0.3.0/tests/test_version.py +0 -6
  32. topolib-0.3.0/topolib/assets/DT14.json +0 -386
  33. topolib-0.3.0/topolib/assets/DT17.json +0 -423
  34. topolib-0.3.0/topolib/assets/FRANCE-43.json +0 -1104
  35. topolib-0.3.0/topolib/assets/JPN-12.json +0 -282
  36. topolib-0.3.0/topolib/assets/NSFNet.json +0 -357
  37. topolib-0.3.0/topolib/assets/PLN-12.json +0 -308
  38. topolib-0.3.0/topolib/assets/UKNet.json +0 -617
  39. topolib-0.3.0/topolib/topolib.egg-info/PKG-INFO +0 -127
  40. topolib-0.3.0/topolib/topolib.egg-info/SOURCES.txt +0 -38
  41. topolib-0.3.0/topolib/topolib.egg-info/dependency_links.txt +0 -1
  42. topolib-0.3.0/topolib/topolib.egg-info/requires.txt +0 -2
  43. topolib-0.3.0/topolib/topolib.egg-info/top_level.txt +0 -4
  44. {topolib-0.3.0 → topolib-0.4.2}/LICENSE +0 -0
  45. {topolib-0.3.0 → topolib-0.4.2}/topolib/analysis/__init__.py +0 -0
  46. {topolib-0.3.0 → topolib-0.4.2}/topolib/elements/__init__.py +0 -0
  47. {topolib-0.3.0 → topolib-0.4.2}/topolib/elements/link.py +0 -0
  48. {topolib-0.3.0 → topolib-0.4.2}/topolib/topology/__init__.py +0 -0
  49. {topolib-0.3.0 → topolib-0.4.2}/topolib/topology/path.py +0 -0
topolib-0.4.2/PKG-INFO ADDED
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.4
2
+ Name: topolib
3
+ Version: 0.4.2
4
+ Summary: A compact Python library for modeling, analyzing, and visualizing optical network topologies.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: network,topology,optical,analysis,visualization
8
+ Author: Danilo Bórquez-Paredes
9
+ Author-email: danilo.borquez.p@uai.cl
10
+ Requires-Python: >=3.10
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Dist: contextily
23
+ Requires-Dist: geopandas
24
+ Requires-Dist: matplotlib
25
+ Requires-Dist: networkx (>=2.6)
26
+ Requires-Dist: numpy (>=1.21)
27
+ Requires-Dist: shapely
28
+ Project-URL: Documentation, https://topolib.readthedocs.io/
29
+ Project-URL: Homepage, https://gitlab.com/DaniloBorquez/topolib
30
+ Project-URL: Repository, https://gitlab.com/DaniloBorquez/topolib
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Topolib 🚀
34
+ # Topolib 🚀
35
+
36
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
37
+ [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
38
+ [![Issues](https://img.shields.io/badge/issues-on%20GitLab-blue.svg)](https://gitlab.com/DaniloBorquez/topolib/-/issues)
39
+ [![Develop coverage](https://gitlab.com/DaniloBorquez/topolib/badges/develop/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=develop)
40
+ [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
41
+ [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
42
+
43
+ > **Topolib** is a compact, modular Python library for modeling, analyzing, and visualizing optical network topologies.
44
+ > **Goal:** Provide researchers and engineers with a simple, extensible toolkit for working with nodes, links, metrics, and map-based visualizations.
45
+ >
46
+ > 🌐 **Model** | 📊 **Analyze** | 🗺️ **Visualize** | 🧩 **Extend**
47
+
48
+ ---
49
+
50
+ ## 📂 Examples
51
+
52
+ Explore ready-to-run usage examples in the [`examples/`](examples/) folder!
53
+ - [Show topology on a map](examples/show_topology_in_map.py) 🗺️
54
+ - More coming soon!
55
+
56
+ ---
57
+
58
+ ## 🧭 Overview
59
+
60
+ Topolib is organized into four main modules:
61
+
62
+ - 🧱 **Elements:** `Node`, `Link` — basic building blocks
63
+ - 🕸️ **Topology:** `Topology`, `Path` — manage nodes, links, paths, and adjacency
64
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
65
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
66
+
67
+ ---
68
+
69
+ ## ✨ Features
70
+
71
+ - Modular, extensible design
72
+ - Easy-to-use classes for nodes, links, and paths
73
+ - Built-in metrics and analysis helpers
74
+ - JSON import/export and interoperability
75
+ - Ready for Sphinx, Read the Docs, and PyPI
76
+
77
+ ---
78
+
79
+ ## ⚡ Quickstart
80
+
81
+ ```bash
82
+ python -m venv .venv
83
+ source .venv/bin/activate
84
+ pip install -U pip
85
+ pip install topolib
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 📚 Documentation
91
+
92
+ Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
93
+
94
+ ---
95
+
96
+ ## 📝 Basic usage
97
+
98
+ ```python
99
+ from topolib.elements.node import Node
100
+ from topolib.topology.topology import Topology
101
+
102
+ n1 = Node(1, 'A', 10.0, 20.0)
103
+ n2 = Node(2, 'B', 11.0, 21.0)
104
+ topo = Topology(nodes=[n1, n2])
105
+ # Add links, compute metrics, visualize, etc.
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 🛠️ Development
111
+
112
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
113
+
114
+ ---
115
+
116
+ ## 📄 License
117
+
118
+ MIT — see [`LICENSE`](LICENSE) for details.
119
+
@@ -0,0 +1,86 @@
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
+ - More coming soon!
23
+
24
+ ---
25
+
26
+ ## 🧭 Overview
27
+
28
+ Topolib is organized into four main modules:
29
+
30
+ - 🧱 **Elements:** `Node`, `Link` — basic building blocks
31
+ - 🕸️ **Topology:** `Topology`, `Path` — manage nodes, links, paths, and adjacency
32
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
33
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
34
+
35
+ ---
36
+
37
+ ## ✨ Features
38
+
39
+ - Modular, extensible design
40
+ - Easy-to-use classes for nodes, links, and paths
41
+ - Built-in metrics and analysis helpers
42
+ - JSON import/export and interoperability
43
+ - Ready for Sphinx, Read the Docs, and PyPI
44
+
45
+ ---
46
+
47
+ ## ⚡ Quickstart
48
+
49
+ ```bash
50
+ python -m venv .venv
51
+ source .venv/bin/activate
52
+ pip install -U pip
53
+ pip install topolib
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 📚 Documentation
59
+
60
+ Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
61
+
62
+ ---
63
+
64
+ ## 📝 Basic usage
65
+
66
+ ```python
67
+ from topolib.elements.node import Node
68
+ from topolib.topology.topology import Topology
69
+
70
+ n1 = Node(1, 'A', 10.0, 20.0)
71
+ n2 = Node(2, 'B', 11.0, 21.0)
72
+ topo = Topology(nodes=[n1, n2])
73
+ # Add links, compute metrics, visualize, etc.
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 🛠️ Development
79
+
80
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
81
+
82
+ ---
83
+
84
+ ## 📄 License
85
+
86
+ MIT — see [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,52 @@
1
+
2
+ [tool.poetry]
3
+ name = "topolib"
4
+ # Poetry requires a version field, but poetry-dynamic-versioning will override it
5
+ version = "0.4.2"
6
+ description = "A compact Python library for modeling, analyzing, and visualizing optical network topologies."
7
+ authors = ["Danilo Bórquez-Paredes <danilo.borquez.p@uai.cl>"]
8
+ license = "MIT"
9
+ readme = "README.md"
10
+ repository = "https://gitlab.com/DaniloBorquez/topolib"
11
+ documentation = "https://topolib.readthedocs.io/"
12
+ homepage = "https://gitlab.com/DaniloBorquez/topolib"
13
+ keywords = ["network", "topology", "optical", "analysis", "visualization"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "Operating System :: OS Independent",
17
+ "Intended Audience :: Science/Research",
18
+ "Topic :: Scientific/Engineering :: Information Analysis",
19
+ "Topic :: Software Development :: Libraries :: Python Modules"
20
+ ]
21
+ packages = [
22
+ { include = "topolib" }
23
+ ]
24
+
25
+ [tool.poetry.dependencies]
26
+ python = ">=3.10"
27
+ numpy = ">=1.21"
28
+ networkx = ">=2.6"
29
+ matplotlib = "*"
30
+ contextily = "*"
31
+ geopandas = "*"
32
+ shapely = "*"
33
+
34
+
35
+ [tool.poetry.group.dev.dependencies]
36
+ pytest = "*"
37
+ pytest-cov = "*"
38
+ matplotlib = "*"
39
+ contextily = "*"
40
+ geopandas = "*"
41
+ shapely = "*"
42
+
43
+ [build-system]
44
+ requires = ["poetry-core>=1.0.0"]
45
+ build-backend = "poetry.core.masonry.api"
46
+
47
+ [tool.poetry-dynamic-versioning]
48
+ enable = false
49
+ vcs = "git"
50
+ style = "pep440"
51
+ pattern = '(?P<base>\d+\.\d+\.\d+)'
52
+
@@ -0,0 +1,4 @@
1
+ try:
2
+ from ._version import __version__
3
+ except ImportError:
4
+ __version__ = "unknown"
@@ -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
@@ -0,0 +1,285 @@
1
+ {
2
+ "name": "Abilene",
3
+ "nodes": [
4
+ {
5
+ "id": 0,
6
+ "name": "Seattle",
7
+ "weight": 0,
8
+ "longitude": -122.3328481,
9
+ "latitude": 47.6061389,
10
+ "pop": 780995,
11
+ "DC": 58,
12
+ "IXP": 5
13
+ },
14
+ {
15
+ "id": 1,
16
+ "name": "Sunnyvale",
17
+ "weight": 0,
18
+ "longitude": -122.0363496,
19
+ "latitude": 37.36883,
20
+ "pop": 155805,
21
+ "DC": 0,
22
+ "IXP": 0
23
+ },
24
+ {
25
+ "id": 2,
26
+ "name": "Los Angeles",
27
+ "weight": 0,
28
+ "longitude": -118.242643,
29
+ "latitude": 34.0549076,
30
+ "pop": 3820914,
31
+ "DC": 71,
32
+ "IXP": 9
33
+ },
34
+ {
35
+ "id": 3,
36
+ "name": "Denver",
37
+ "weight": 0,
38
+ "longitude": -104.990251,
39
+ "latitude": 39.7392358,
40
+ "pop": 729019,
41
+ "DC": 49,
42
+ "IXP": 6
43
+ },
44
+ {
45
+ "id": 4,
46
+ "name": "Kansas City",
47
+ "weight": 0,
48
+ "longitude": -94.5785667,
49
+ "latitude": 39.0997265,
50
+ "pop": 475378,
51
+ "DC": 25,
52
+ "IXP": 1
53
+ },
54
+ {
55
+ "id": 5,
56
+ "name": "Houston",
57
+ "weight": 0,
58
+ "longitude": -95.3701108,
59
+ "latitude": 29.7600771,
60
+ "pop": 2314157,
61
+ "DC": 55,
62
+ "IXP": 6
63
+ },
64
+ {
65
+ "id": 6,
66
+ "name": "Atlanta",
67
+ "weight": 0,
68
+ "longitude": -84.3885209,
69
+ "latitude": 33.7501275,
70
+ "pop": 510823,
71
+ "DC": 145,
72
+ "IXP": 7
73
+ },
74
+ {
75
+ "id": 7,
76
+ "name": "Indianapolis",
77
+ "weight": 0,
78
+ "longitude": -86.158018,
79
+ "latitude": 39.76909,
80
+ "pop": 887642,
81
+ "DC": 30,
82
+ "IXP": 2
83
+ },
84
+ {
85
+ "id": 8,
86
+ "name": "Chicago",
87
+ "weight": 0,
88
+ "longitude": -87.6323879,
89
+ "latitude": 41.88325,
90
+ "pop": 2664452,
91
+ "DC": 165,
92
+ "IXP": 10
93
+ },
94
+ {
95
+ "id": 9,
96
+ "name": "Washington D.C.",
97
+ "weight": 0,
98
+ "longitude": -77.0368707,
99
+ "latitude": 38.9071923,
100
+ "pop": 689545,
101
+ "DC": 7,
102
+ "IXP": 3
103
+ },
104
+ {
105
+ "id": 10,
106
+ "name": "New York",
107
+ "weight": 0,
108
+ "longitude": -74.0059728,
109
+ "latitude": 40.7127753,
110
+ "pop": 8804190,
111
+ "DC": 70,
112
+ "IXP": 11
113
+ }
114
+ ],
115
+ "links": [
116
+ {
117
+ "id": 0,
118
+ "src": 0,
119
+ "dst": 1,
120
+ "length": 1482.26
121
+ },
122
+ {
123
+ "id": 1,
124
+ "src": 2,
125
+ "dst": 1,
126
+ "length": 649.31
127
+ },
128
+ {
129
+ "id": 2,
130
+ "src": 5,
131
+ "dst": 2,
132
+ "length": 2870.2
133
+ },
134
+ {
135
+ "id": 3,
136
+ "src": 4,
137
+ "dst": 5,
138
+ "length": 1360.7
139
+ },
140
+ {
141
+ "id": 4,
142
+ "src": 3,
143
+ "dst": 0,
144
+ "length": 2123.16
145
+ },
146
+ {
147
+ "id": 5,
148
+ "src": 3,
149
+ "dst": 1,
150
+ "length": 1949.85
151
+ },
152
+ {
153
+ "id": 6,
154
+ "src": 4,
155
+ "dst": 3,
156
+ "length": 1153.26
157
+ },
158
+ {
159
+ "id": 7,
160
+ "src": 8,
161
+ "dst": 7,
162
+ "length": 345.36
163
+ },
164
+ {
165
+ "id": 8,
166
+ "src": 4,
167
+ "dst": 7,
168
+ "length": 933.65
169
+ },
170
+ {
171
+ "id": 9,
172
+ "src": 5,
173
+ "dst": 6,
174
+ "length": 1471.24
175
+ },
176
+ {
177
+ "id": 10,
178
+ "src": 6,
179
+ "dst": 7,
180
+ "length": 912.61
181
+ },
182
+ {
183
+ "id": 11,
184
+ "src": 10,
185
+ "dst": 8,
186
+ "length": 1489.76
187
+ },
188
+ {
189
+ "id": 12,
190
+ "src": 6,
191
+ "dst": 9,
192
+ "length": 1126.74
193
+ },
194
+ {
195
+ "id": 13,
196
+ "src": 9,
197
+ "dst": 10,
198
+ "length": 416.12
199
+ },
200
+ {
201
+ "id": 14,
202
+ "src": 1,
203
+ "dst": 0,
204
+ "length": 1482.26
205
+ },
206
+ {
207
+ "id": 15,
208
+ "src": 1,
209
+ "dst": 2,
210
+ "length": 649.31
211
+ },
212
+ {
213
+ "id": 16,
214
+ "src": 2,
215
+ "dst": 5,
216
+ "length": 2870.2
217
+ },
218
+ {
219
+ "id": 17,
220
+ "src": 5,
221
+ "dst": 4,
222
+ "length": 1360.7
223
+ },
224
+ {
225
+ "id": 18,
226
+ "src": 0,
227
+ "dst": 3,
228
+ "length": 2123.16
229
+ },
230
+ {
231
+ "id": 19,
232
+ "src": 1,
233
+ "dst": 3,
234
+ "length": 1949.85
235
+ },
236
+ {
237
+ "id": 20,
238
+ "src": 3,
239
+ "dst": 4,
240
+ "length": 1153.26
241
+ },
242
+ {
243
+ "id": 21,
244
+ "src": 7,
245
+ "dst": 8,
246
+ "length": 345.36
247
+ },
248
+ {
249
+ "id": 22,
250
+ "src": 7,
251
+ "dst": 4,
252
+ "length": 933.65
253
+ },
254
+ {
255
+ "id": 23,
256
+ "src": 6,
257
+ "dst": 5,
258
+ "length": 1471.24
259
+ },
260
+ {
261
+ "id": 24,
262
+ "src": 7,
263
+ "dst": 6,
264
+ "length": 912.61
265
+ },
266
+ {
267
+ "id": 25,
268
+ "src": 8,
269
+ "dst": 10,
270
+ "length": 1489.76
271
+ },
272
+ {
273
+ "id": 26,
274
+ "src": 9,
275
+ "dst": 6,
276
+ "length": 1126.74
277
+ },
278
+ {
279
+ "id": 27,
280
+ "src": 10,
281
+ "dst": 9,
282
+ "length": 416.12
283
+ }
284
+ ]
285
+ }