unifi-network-maps 1.3.1__py3-none-any.whl → 1.4.1__py3-none-any.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.
- unifi_network_maps/__init__.py +1 -1
- unifi_network_maps/__main__.py +8 -0
- unifi_network_maps/adapters/unifi.py +90 -9
- unifi_network_maps/cli/main.py +320 -23
- unifi_network_maps/io/mock_data.py +23 -0
- unifi_network_maps/io/mock_generate.py +299 -0
- unifi_network_maps/model/lldp.py +26 -12
- unifi_network_maps/model/topology.py +111 -3
- unifi_network_maps/render/device_ports_md.py +462 -0
- unifi_network_maps/render/lldp_md.py +33 -12
- unifi_network_maps/render/mermaid.py +62 -3
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/METADATA +89 -15
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/RECORD +17 -13
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/WHEEL +0 -0
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/entry_points.txt +0 -0
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/licenses/LICENSE +0 -0
- {unifi_network_maps-1.3.1.dist-info → unifi_network_maps-1.4.1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unifi-network-maps
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Dynamic UniFi -> network maps in mermaid or svg
|
|
5
5
|
Author: Merlijn
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,22 +14,21 @@ Classifier: Intended Audience :: System Administrators
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
18
|
Classifier: Topic :: Documentation
|
|
21
19
|
Classifier: Topic :: System :: Networking
|
|
22
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.13
|
|
23
21
|
Description-Content-Type: text/markdown
|
|
24
22
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist: unifi-controller-api
|
|
26
|
-
Requires-Dist: python-dotenv
|
|
27
|
-
Requires-Dist: PyYAML
|
|
23
|
+
Requires-Dist: unifi-controller-api==0.3.2
|
|
24
|
+
Requires-Dist: python-dotenv==1.2.1
|
|
25
|
+
Requires-Dist: PyYAML==6.0.3
|
|
28
26
|
Provides-Extra: dev
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist: pytest
|
|
32
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: Faker==40.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pre-commit==4.5.1; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov==7.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff==0.14.10; extra == "dev"
|
|
33
32
|
Dynamic: license-file
|
|
34
33
|
|
|
35
34
|
# unifi-network-maps
|
|
@@ -38,13 +37,14 @@ Dynamic UniFi -> Mermaid network maps generated from LLDP topology.
|
|
|
38
37
|
|
|
39
38
|
## Setup
|
|
40
39
|
|
|
41
|
-
- Python >= 3.
|
|
40
|
+
- Python >= 3.13
|
|
42
41
|
- Virtualenv required
|
|
43
42
|
|
|
44
43
|
```bash
|
|
45
44
|
python -m venv .venv
|
|
46
45
|
source .venv/bin/activate
|
|
47
|
-
pip install -
|
|
46
|
+
pip install -r requirements-build.txt
|
|
47
|
+
pip install -e . -c constraints.txt
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Local install (non-editable):
|
|
@@ -101,6 +101,15 @@ Isometric SVG output:
|
|
|
101
101
|
|
|
102
102
|
```bash
|
|
103
103
|
unifi-network-maps --format svg-iso --output ./network.svg
|
|
104
|
+
|
|
105
|
+
# Single-page MkDocs output (ports included, no clients)
|
|
106
|
+
unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
|
|
107
|
+
|
|
108
|
+
# MkDocs output (map + legend + gateway/switch port tables)
|
|
109
|
+
unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
|
|
110
|
+
|
|
111
|
+
# Include wired clients in the port tables
|
|
112
|
+
unifi-network-maps --format mkdocs --include-clients --output ./docs/unifi-network.md
|
|
104
113
|
```
|
|
105
114
|
|
|
106
115
|
SVG size overrides:
|
|
@@ -118,12 +127,61 @@ Legend only:
|
|
|
118
127
|
unifi-network-maps --legend-only --stdout
|
|
119
128
|
```
|
|
120
129
|
|
|
130
|
+
## Examples (mock data)
|
|
131
|
+
|
|
132
|
+
These examples are generated from `examples/mock_data.json` (safe, anonymized fixture).
|
|
133
|
+
Mock generation requires dev dependencies (`pip install -r requirements-dev.txt -c constraints.txt`).
|
|
134
|
+
Regenerate the fixture + SVG with `make mock-data`.
|
|
135
|
+
|
|
136
|
+
Generate mock data (dev-only, uses Faker):
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
unifi-network-maps --generate-mock examples/mock_data.json --mock-seed 1337
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Generate the isometric SVG:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
unifi-network-maps --mock-data examples/mock_data.json \
|
|
146
|
+
--include-ports --include-clients --format svg-iso \
|
|
147
|
+
--output examples/output/network_ports_clients_iso.svg
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+

|
|
151
|
+
|
|
152
|
+
Mermaid example with ports:
|
|
153
|
+
|
|
154
|
+
```mermaid
|
|
155
|
+
graph TB
|
|
156
|
+
core_switch["Core Switch"] ---|"Core Switch: Port 7 (AP Attic) <-> AP Attic: Port 1 (Core Switch)"| ap_attic["AP Attic"];
|
|
157
|
+
core_switch["Core Switch"] ---|"Core Switch: Port 3 (AP Living Room) <-> AP Living Room: Port 1 (Core Switch)"| ap_living_room["AP Living Room"];
|
|
158
|
+
cloud_gateway["Cloud Gateway"] ---|"Cloud Gateway: Port 9 (Core Switch) <-> Core Switch: Port 1 (Cloud Gateway)"| core_switch["Core Switch"];
|
|
159
|
+
class cloud_gateway node_gateway;
|
|
160
|
+
class core_switch node_switch;
|
|
161
|
+
class ap_living_room node_ap;
|
|
162
|
+
class ap_attic node_ap;
|
|
163
|
+
classDef node_gateway fill:#ffe3b3,stroke:#d98300,stroke-width:1px;
|
|
164
|
+
classDef node_switch fill:#d6ecff,stroke:#3a7bd5,stroke-width:1px;
|
|
165
|
+
classDef node_ap fill:#d7f5e7,stroke:#27ae60,stroke-width:1px;
|
|
166
|
+
classDef node_client fill:#f2e5ff,stroke:#7f3fbf,stroke-width:1px;
|
|
167
|
+
classDef node_other fill:#eeeeee,stroke:#8f8f8f,stroke-width:1px;
|
|
168
|
+
classDef node_legend font-size:10px;
|
|
169
|
+
linkStyle 0 stroke:#1e88e5,stroke-width:2px,arrowhead:none;
|
|
170
|
+
linkStyle 1 stroke:#1e88e5,stroke-width:2px,arrowhead:none;
|
|
171
|
+
```
|
|
172
|
+
|
|
121
173
|
## Local install check
|
|
122
174
|
|
|
123
175
|
```bash
|
|
124
176
|
pip install .
|
|
125
177
|
```
|
|
126
178
|
|
|
179
|
+
## Dev
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
pip install -r requirements-dev.txt -c constraints.txt
|
|
183
|
+
```
|
|
184
|
+
|
|
127
185
|
## Release
|
|
128
186
|
|
|
129
187
|
Build and upload to PyPI:
|
|
@@ -164,6 +222,14 @@ The CLI groups options by category (`Source`, `Functional`, `Mermaid`, `SVG`, `O
|
|
|
164
222
|
Source:
|
|
165
223
|
- `--site`: override `UNIFI_SITE`.
|
|
166
224
|
- `--env-file`: load environment variables from a specific `.env` file.
|
|
225
|
+
- `--mock-data`: use mock data JSON instead of the UniFi API.
|
|
226
|
+
Mock:
|
|
227
|
+
- `--generate-mock`: write mock data JSON and exit.
|
|
228
|
+
- `--mock-seed`: seed for deterministic mock generation.
|
|
229
|
+
- `--mock-switches`: number of switches to generate.
|
|
230
|
+
- `--mock-aps`: number of access points to generate.
|
|
231
|
+
- `--mock-wired-clients`: number of wired clients to generate.
|
|
232
|
+
- `--mock-wireless-clients`: number of wireless clients to generate.
|
|
167
233
|
|
|
168
234
|
Functional:
|
|
169
235
|
- `--include-ports`: show port labels (Mermaid shows both ends; SVG shows compact labels).
|
|
@@ -174,6 +240,8 @@ Functional:
|
|
|
174
240
|
Mermaid:
|
|
175
241
|
- `--direction LR|TB`: diagram direction for Mermaid (default TB).
|
|
176
242
|
- `--group-by-type`: group nodes by gateway/switch/AP in Mermaid subgraphs.
|
|
243
|
+
- `--legend-scale`: scale legend font/link sizes for Mermaid outputs (default 1.0).
|
|
244
|
+
- `--legend-style auto|compact|diagram`: legend rendering mode (auto uses compact for mkdocs).
|
|
177
245
|
- `--legend-only`: render just the legend as a separate Mermaid graph (Mermaid only).
|
|
178
246
|
|
|
179
247
|
SVG:
|
|
@@ -181,9 +249,10 @@ SVG:
|
|
|
181
249
|
- `--theme-file`: load a YAML theme for Mermaid + SVG colors (see `examples/theme.yaml` and `examples/theme-dark.yaml`).
|
|
182
250
|
|
|
183
251
|
Output:
|
|
184
|
-
- `--format mermaid|svg|svg-iso|lldp-md`: output format (default mermaid).
|
|
252
|
+
- `--format mermaid|svg|svg-iso|lldp-md|mkdocs`: output format (default mermaid).
|
|
185
253
|
- `--stdout`: write output to stdout.
|
|
186
254
|
- `--markdown`: wrap Mermaid output in a code fence.
|
|
255
|
+
- `--mkdocs-sidebar-legend`: write assets to place the compact legend in the MkDocs right sidebar.
|
|
187
256
|
|
|
188
257
|
Debug:
|
|
189
258
|
- `--debug-dump`: dump gateway + sample devices to stderr for debugging.
|
|
@@ -228,5 +297,10 @@ svg:
|
|
|
228
297
|
to: "#b6dcff"
|
|
229
298
|
```
|
|
230
299
|
|
|
300
|
+
## MkDocs Material example
|
|
301
|
+
|
|
302
|
+
See `examples/mkdocs/` for a ready-to-use setup that renders Mermaid diagrams
|
|
303
|
+
with Material for MkDocs, including a sample `unifi-network` page and legend.
|
|
304
|
+
|
|
231
305
|
The built-in themes live at `src/unifi_network_maps/assets/themes/default.yaml` and
|
|
232
306
|
`src/unifi_network_maps/assets/themes/dark.yaml`.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
unifi_network_maps/__init__.py,sha256
|
|
1
|
+
unifi_network_maps/__init__.py,sha256=BqOI5y46o1G1RWC9bF1DPL-YM68lGYPmZt1pn6FZFZs,22
|
|
2
|
+
unifi_network_maps/__main__.py,sha256=XsOjaqslAVgyVlOTokjVddZ2iT8apZXpJ_OB-9WEEe4,179
|
|
2
3
|
unifi_network_maps/adapters/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
3
4
|
unifi_network_maps/adapters/config.py,sha256=Bx9JDZxxY7Gjxyb8FDT0dxiKfgXt_TmzTDbgvpwB53s,1548
|
|
4
|
-
unifi_network_maps/adapters/unifi.py,sha256=
|
|
5
|
+
unifi_network_maps/adapters/unifi.py,sha256=H-yANmXaXoQjItVKZaAP44ATREZ2LtPrz_M48wAcTqI,7020
|
|
5
6
|
unifi_network_maps/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
7
|
unifi_network_maps/assets/icons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
8
|
unifi_network_maps/assets/icons/access-point.svg,sha256=RJOgO2s9Ino5lWRrh4V7q8Jdwffros5bQq3UeDuQYF4,742
|
|
@@ -51,25 +52,28 @@ unifi_network_maps/assets/themes/dark.yaml,sha256=F86A25kd0VSCCpN4jcMZxPWWtqNC5f
|
|
|
51
52
|
unifi_network_maps/assets/themes/default.yaml,sha256=F2Jj18NmdaJ_zyERvGAn8NEWBwapjtozrtZUxayd5AU,849
|
|
52
53
|
unifi_network_maps/cli/__init__.py,sha256=2FdmLMpYFh_7P0ew2LnieLANf6ni43Ht9FKzYUDiNis,770
|
|
53
54
|
unifi_network_maps/cli/__main__.py,sha256=nK_jh78VW3h3DRvSpjzpcf64zkCqniP2k82xUR9Hw2I,147
|
|
54
|
-
unifi_network_maps/cli/main.py,sha256=
|
|
55
|
+
unifi_network_maps/cli/main.py,sha256=xAPFmzxjNbpwrR_lyLv66m0EqrUy7KFYZ20Dt8Q2NhE,19896
|
|
55
56
|
unifi_network_maps/io/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
56
57
|
unifi_network_maps/io/debug.py,sha256=wTSGMARfVh_U2R5vD-n9DjwQHdhMpypmVvoXRUdy68k,1461
|
|
57
58
|
unifi_network_maps/io/export.py,sha256=v3x6mSXmbO3dWtNQv4nGNGVqMCIE0mvTBGTKsNJBg6o,352
|
|
59
|
+
unifi_network_maps/io/mock_data.py,sha256=uiQ8Ta8oxs5D1MUA1ONWmp09sxH0-FNlz3SJBXMeezo,714
|
|
60
|
+
unifi_network_maps/io/mock_generate.py,sha256=xKaPRj-STtI154SMTPP9iCl0s7AVZekX4uPb-bMxRvA,8508
|
|
58
61
|
unifi_network_maps/model/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
59
62
|
unifi_network_maps/model/labels.py,sha256=m_k8mbzWtOSDOjjHhLUqwIw93pg98HAtGtHkiERXmek,1135
|
|
60
|
-
unifi_network_maps/model/lldp.py,sha256=
|
|
63
|
+
unifi_network_maps/model/lldp.py,sha256=SrPW5XC2lfJgaGeVx-KnSFNltyok7gIWWQNg1SkOaj4,3300
|
|
61
64
|
unifi_network_maps/model/ports.py,sha256=o3NBlXcC5VV5iPWJsO4Ll1mRKJZC0f8zTHdlkkE34GU,609
|
|
62
|
-
unifi_network_maps/model/topology.py,sha256=
|
|
65
|
+
unifi_network_maps/model/topology.py,sha256=TxHWR4JmAcvD9yOaiq87qwnTukstCaAxziJMyOmtnak,25424
|
|
63
66
|
unifi_network_maps/render/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
64
|
-
unifi_network_maps/render/
|
|
65
|
-
unifi_network_maps/render/
|
|
67
|
+
unifi_network_maps/render/device_ports_md.py,sha256=JP2Sjvq-O9h20RPygr7WEMp2R1XhLe_iw3gfgoD-SDM,15151
|
|
68
|
+
unifi_network_maps/render/lldp_md.py,sha256=0CwFz1KPeU8gpu_wslPsvR3j6yunC4XX1uRETrctveI,9595
|
|
69
|
+
unifi_network_maps/render/mermaid.py,sha256=zXSPkjHxFuQk4s5ENtqSobiXiMur4Tiq1aYVa7aUrhk,8158
|
|
66
70
|
unifi_network_maps/render/mermaid_theme.py,sha256=QReSBFoYSIz7vgAwyHx-9f4ucbSgMTGvo1Ffa2ZfzDQ,1527
|
|
67
71
|
unifi_network_maps/render/svg.py,sha256=9TIuo63EJCoHO6Mwm26dLLcfsvTpOZaZkUegDIxv6ts,33018
|
|
68
72
|
unifi_network_maps/render/svg_theme.py,sha256=Si1ArM3v_-wAvHZyLFPiOZ0ohQRd6ezIckwC3_b-WIw,2684
|
|
69
73
|
unifi_network_maps/render/theme.py,sha256=-cPvj9dfmOpBD3Ohpye_yTBWxXtsE0-g73mekqoh5kA,3606
|
|
70
|
-
unifi_network_maps-1.
|
|
71
|
-
unifi_network_maps-1.
|
|
72
|
-
unifi_network_maps-1.
|
|
73
|
-
unifi_network_maps-1.
|
|
74
|
-
unifi_network_maps-1.
|
|
75
|
-
unifi_network_maps-1.
|
|
74
|
+
unifi_network_maps-1.4.1.dist-info/licenses/LICENSE,sha256=mYo1siIIfIwyfdOuK2-Zt0ij2xBTii2hnpeTu79nD80,1074
|
|
75
|
+
unifi_network_maps-1.4.1.dist-info/METADATA,sha256=z4KBMpd033ok2Thpcfvik6qi2PMCOR2ctQBu6E791PY,9035
|
|
76
|
+
unifi_network_maps-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
77
|
+
unifi_network_maps-1.4.1.dist-info/entry_points.txt,sha256=cdJ7jsBgNgHxSflYUOqgz5BbvuM0Nnh-x8_Hbyh_LFg,67
|
|
78
|
+
unifi_network_maps-1.4.1.dist-info/top_level.txt,sha256=G0rUX1PNfVCn1u-KtB6QjFQHopCOVLnPMczvPOoraHg,19
|
|
79
|
+
unifi_network_maps-1.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|