unifi-network-maps 1.4.0__py3-none-any.whl → 1.4.2__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 +266 -24
- unifi_network_maps/cli/main.py +352 -107
- unifi_network_maps/io/debug.py +15 -5
- unifi_network_maps/io/export.py +20 -1
- unifi_network_maps/model/topology.py +125 -71
- unifi_network_maps/render/device_ports_md.py +31 -18
- unifi_network_maps/render/lldp_md.py +87 -43
- unifi_network_maps/render/mermaid.py +96 -49
- unifi_network_maps/render/svg.py +614 -318
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.dist-info}/METADATA +57 -82
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.dist-info}/RECORD +17 -16
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.dist-info}/WHEEL +0 -0
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.dist-info}/entry_points.txt +0 -0
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.dist-info}/licenses/LICENSE +0 -0
- {unifi_network_maps-1.4.0.dist-info → unifi_network_maps-1.4.2.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.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Dynamic UniFi -> network maps in mermaid or svg
|
|
5
5
|
Author: Merlijn
|
|
6
6
|
License-Expression: MIT
|
|
@@ -25,31 +25,38 @@ Requires-Dist: python-dotenv==1.2.1
|
|
|
25
25
|
Requires-Dist: PyYAML==6.0.3
|
|
26
26
|
Provides-Extra: dev
|
|
27
27
|
Requires-Dist: Faker==40.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: behave==1.3.3; extra == "dev"
|
|
28
29
|
Requires-Dist: pre-commit==4.5.1; extra == "dev"
|
|
29
30
|
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
30
31
|
Requires-Dist: pytest-cov==7.0.0; extra == "dev"
|
|
31
|
-
Requires-Dist:
|
|
32
|
+
Requires-Dist: pyright==1.1.408; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff==0.14.11; extra == "dev"
|
|
32
34
|
Dynamic: license-file
|
|
33
35
|
|
|
34
36
|
# unifi-network-maps
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
[](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/ci.yml)
|
|
39
|
+
[](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/codeql.yml)
|
|
40
|
+
[](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/publish.yml)
|
|
41
|
+
[](https://pypi.org/project/unifi-network-maps/)
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
Dynamic UniFi network maps generated from LLDP topology. Output can be a range of options including Markdown,
|
|
44
|
+
Mermaid, SVG (including an Isometric view), and MkDocs.
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
PyPI:
|
|
42
49
|
|
|
43
50
|
```bash
|
|
44
|
-
|
|
45
|
-
source .venv/bin/activate
|
|
46
|
-
pip install -r requirements-build.txt
|
|
47
|
-
pip install -e . -c constraints.txt
|
|
51
|
+
pip install unifi-network-maps
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
From source:
|
|
51
55
|
|
|
52
56
|
```bash
|
|
57
|
+
python -m venv .venv
|
|
58
|
+
source .venv/bin/activate
|
|
59
|
+
pip install -r requirements-build.txt
|
|
53
60
|
pip install .
|
|
54
61
|
```
|
|
55
62
|
|
|
@@ -63,6 +70,7 @@ export UNIFI_SITE=default
|
|
|
63
70
|
export UNIFI_USER=local_admin
|
|
64
71
|
export UNIFI_PASS=********
|
|
65
72
|
export UNIFI_VERIFY_SSL=false
|
|
73
|
+
export UNIFI_REQUEST_TIMEOUT_SECONDS=10
|
|
66
74
|
```
|
|
67
75
|
|
|
68
76
|
Use a custom env file:
|
|
@@ -71,7 +79,7 @@ Use a custom env file:
|
|
|
71
79
|
unifi-network-maps --env-file ./site.env --stdout
|
|
72
80
|
```
|
|
73
81
|
|
|
74
|
-
##
|
|
82
|
+
## Quickstart
|
|
75
83
|
|
|
76
84
|
Basic map (tree layout by LLDP hops):
|
|
77
85
|
|
|
@@ -85,6 +93,8 @@ Write Markdown for notes tools:
|
|
|
85
93
|
unifi-network-maps --markdown --output ./network.md
|
|
86
94
|
```
|
|
87
95
|
|
|
96
|
+
## Usage
|
|
97
|
+
|
|
88
98
|
Show ports + clients:
|
|
89
99
|
|
|
90
100
|
```bash
|
|
@@ -101,23 +111,29 @@ Isometric SVG output:
|
|
|
101
111
|
|
|
102
112
|
```bash
|
|
103
113
|
unifi-network-maps --format svg-iso --output ./network.svg
|
|
114
|
+
```
|
|
104
115
|
|
|
105
|
-
|
|
106
|
-
unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
|
|
116
|
+
MkDocs output (ports included, no clients):
|
|
107
117
|
|
|
108
|
-
|
|
118
|
+
```bash
|
|
109
119
|
unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
|
|
120
|
+
```
|
|
110
121
|
|
|
111
|
-
|
|
122
|
+
MkDocs output with clients:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
112
125
|
unifi-network-maps --format mkdocs --include-clients --output ./docs/unifi-network.md
|
|
113
126
|
```
|
|
114
127
|
|
|
115
|
-
|
|
128
|
+
MkDocs output with dual Mermaid blocks for Material theme switching:
|
|
116
129
|
|
|
117
130
|
```bash
|
|
118
|
-
unifi-network-maps --format
|
|
131
|
+
unifi-network-maps --format mkdocs --mkdocs-dual-theme --output ./docs/unifi-network.md
|
|
132
|
+
```
|
|
119
133
|
|
|
120
|
-
|
|
134
|
+
LLDP tables for troubleshooting:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
121
137
|
unifi-network-maps --format lldp-md --output ./lldp.md
|
|
122
138
|
```
|
|
123
139
|
|
|
@@ -142,9 +158,7 @@ unifi-network-maps --generate-mock examples/mock_data.json --mock-seed 1337
|
|
|
142
158
|
Generate the isometric SVG:
|
|
143
159
|
|
|
144
160
|
```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
|
|
161
|
+
unifi-network-maps --mock-data examples/mock_data.json --include-ports --include-clients --format svg-iso --output examples/output/network_ports_clients_iso.svg
|
|
148
162
|
```
|
|
149
163
|
|
|
150
164
|

|
|
@@ -170,50 +184,14 @@ graph TB
|
|
|
170
184
|
linkStyle 1 stroke:#1e88e5,stroke-width:2px,arrowhead:none;
|
|
171
185
|
```
|
|
172
186
|
|
|
173
|
-
##
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
pip install .
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Dev
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
pip install -r requirements-dev.txt -c constraints.txt
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Release
|
|
186
|
-
|
|
187
|
-
Build and upload to PyPI:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
python -m pip install build twine
|
|
191
|
-
python -m build
|
|
192
|
-
twine upload dist/*
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
Tagging is recommended before release:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
git tag -a vX.Y.Z -m "vX.Y.Z"
|
|
199
|
-
git push origin vX.Y.Z
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
See `LICENSES.md` for third-party license info.
|
|
203
|
-
|
|
204
|
-
## Installation
|
|
205
|
-
|
|
206
|
-
PyPI: https://pypi.org/project/unifi-network-maps/
|
|
187
|
+
## MkDocs Material example
|
|
207
188
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
```
|
|
189
|
+
See `examples/mkdocs/` for a ready-to-use setup that renders Mermaid diagrams
|
|
190
|
+
with Material for MkDocs, including a sample `unifi-network` page and legend.
|
|
211
191
|
|
|
212
|
-
|
|
192
|
+
The built-in themes live at `src/unifi_network_maps/assets/themes/default.yaml` and
|
|
193
|
+
`src/unifi_network_maps/assets/themes/dark.yaml`.
|
|
213
194
|
|
|
214
|
-
```bash
|
|
215
|
-
unifi-network-maps --help
|
|
216
|
-
```
|
|
217
195
|
|
|
218
196
|
## Options
|
|
219
197
|
|
|
@@ -223,6 +201,7 @@ Source:
|
|
|
223
201
|
- `--site`: override `UNIFI_SITE`.
|
|
224
202
|
- `--env-file`: load environment variables from a specific `.env` file.
|
|
225
203
|
- `--mock-data`: use mock data JSON instead of the UniFi API.
|
|
204
|
+
|
|
226
205
|
Mock:
|
|
227
206
|
- `--generate-mock`: write mock data JSON and exit.
|
|
228
207
|
- `--mock-seed`: seed for deterministic mock generation.
|
|
@@ -236,6 +215,7 @@ Functional:
|
|
|
236
215
|
- `--include-clients`: add active wired clients as leaf nodes.
|
|
237
216
|
- `--client-scope wired|wireless|all`: which client types to include (default wired).
|
|
238
217
|
- `--only-unifi`: only include neighbors that are UniFi devices.
|
|
218
|
+
- `--no-cache`: disable UniFi API cache reads and writes.
|
|
239
219
|
|
|
240
220
|
Mermaid:
|
|
241
221
|
- `--direction LR|TB`: diagram direction for Mermaid (default TB).
|
|
@@ -253,25 +233,13 @@ Output:
|
|
|
253
233
|
- `--stdout`: write output to stdout.
|
|
254
234
|
- `--markdown`: wrap Mermaid output in a code fence.
|
|
255
235
|
- `--mkdocs-sidebar-legend`: write assets to place the compact legend in the MkDocs right sidebar.
|
|
236
|
+
- `--mkdocs-dual-theme`: render light/dark Mermaid blocks for Material theme switching.
|
|
237
|
+
- `--mkdocs-timestamp-zone`: timezone for mkdocs timestamp (`Europe/Amsterdam` default; use `off` to disable).
|
|
256
238
|
|
|
257
239
|
Debug:
|
|
258
240
|
- `--debug-dump`: dump gateway + sample devices to stderr for debugging.
|
|
259
241
|
- `--debug-sample N`: number of non-gateway devices in debug dump (default 2).
|
|
260
242
|
|
|
261
|
-
## Notes
|
|
262
|
-
|
|
263
|
-
- Default output is top-to-bottom (TB) and rendered as a hop-based tree from the gateway(s).
|
|
264
|
-
- Nodes are color-coded by type (gateway/switch/AP/client) with a sensible default palette.
|
|
265
|
-
- PoE links are highlighted in blue and annotated with a power icon when detected from `port_table`.
|
|
266
|
-
- Wireless client links render as dashed lines to indicate the last-known upstream.
|
|
267
|
-
- SVG output uses vendored device glyphs from `src/unifi_network_maps/assets/icons`.
|
|
268
|
-
- Isometric SVG output uses MIT-licensed icons from `markmanx/isopacks`.
|
|
269
|
-
- SVG port labels render inside child nodes for readability.
|
|
270
|
-
|
|
271
|
-
## AI Disclosure
|
|
272
|
-
|
|
273
|
-
This project used OpenAI Codex as a coding assistant for portions of the implementation and documentation.
|
|
274
|
-
|
|
275
243
|
## Theme file
|
|
276
244
|
|
|
277
245
|
Example theme YAML (override only the values you want):
|
|
@@ -297,10 +265,17 @@ svg:
|
|
|
297
265
|
to: "#b6dcff"
|
|
298
266
|
```
|
|
299
267
|
|
|
300
|
-
##
|
|
268
|
+
## Notes
|
|
301
269
|
|
|
302
|
-
|
|
303
|
-
|
|
270
|
+
- Default output is top-to-bottom (TB) and rendered as a hop-based tree from the gateway(s).
|
|
271
|
+
- Nodes are color-coded by type (gateway/switch/AP/client) with a sensible default palette.
|
|
272
|
+
- PoE links are highlighted in blue and annotated with a power icon when detected from `port_table`.
|
|
273
|
+
- Wireless client links render as dashed lines to indicate the last-known upstream.
|
|
274
|
+
- SVG output uses vendored device glyphs from `src/unifi_network_maps/assets/icons`.
|
|
275
|
+
- Isometric SVG output uses MIT-licensed icons from `markmanx/isopacks`.
|
|
276
|
+
- SVG port labels render inside child nodes for readability.
|
|
304
277
|
|
|
305
|
-
|
|
306
|
-
|
|
278
|
+
|
|
279
|
+
## AI Disclosure
|
|
280
|
+
|
|
281
|
+
This project used OpenAI Codex as a coding assistant for portions of the implementation and documentation.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
unifi_network_maps/__init__.py,sha256=
|
|
1
|
+
unifi_network_maps/__init__.py,sha256=qjngKmjcwKn1c_BwAouVdai-TbnuKZo56EbqRdILxaI,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=olrs-K7EWK7Uhib8pjtPnkZg3LhnnSz-lcGuHG8RsOI,15140
|
|
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,28 +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=y053K-EbnAvxZ073-AEHhAGYWSvc4-UcoDTKpaBsvZY,27319
|
|
55
56
|
unifi_network_maps/io/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
56
|
-
unifi_network_maps/io/debug.py,sha256=
|
|
57
|
-
unifi_network_maps/io/export.py,sha256=
|
|
57
|
+
unifi_network_maps/io/debug.py,sha256=eUVs6GLfs6VqI6ma8ra7NLhC3q4ek2K8OSRLnpQDF9s,1745
|
|
58
|
+
unifi_network_maps/io/export.py,sha256=2vURunQDja-_fKKMb-gQG-n34aeM8GFprNJqcGaP4qg,843
|
|
58
59
|
unifi_network_maps/io/mock_data.py,sha256=uiQ8Ta8oxs5D1MUA1ONWmp09sxH0-FNlz3SJBXMeezo,714
|
|
59
60
|
unifi_network_maps/io/mock_generate.py,sha256=xKaPRj-STtI154SMTPP9iCl0s7AVZekX4uPb-bMxRvA,8508
|
|
60
61
|
unifi_network_maps/model/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
61
62
|
unifi_network_maps/model/labels.py,sha256=m_k8mbzWtOSDOjjHhLUqwIw93pg98HAtGtHkiERXmek,1135
|
|
62
63
|
unifi_network_maps/model/lldp.py,sha256=SrPW5XC2lfJgaGeVx-KnSFNltyok7gIWWQNg1SkOaj4,3300
|
|
63
64
|
unifi_network_maps/model/ports.py,sha256=o3NBlXcC5VV5iPWJsO4Ll1mRKJZC0f8zTHdlkkE34GU,609
|
|
64
|
-
unifi_network_maps/model/topology.py,sha256=
|
|
65
|
+
unifi_network_maps/model/topology.py,sha256=JfpY6Pam_pgqnnmsBmzy3oDv4OCi4Ezc8msxvp5Z5NQ,26784
|
|
65
66
|
unifi_network_maps/render/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
66
|
-
unifi_network_maps/render/device_ports_md.py,sha256=
|
|
67
|
-
unifi_network_maps/render/lldp_md.py,sha256=
|
|
68
|
-
unifi_network_maps/render/mermaid.py,sha256=
|
|
67
|
+
unifi_network_maps/render/device_ports_md.py,sha256=QoRiuP9l2CH8BYRHXRaWM5wyucAURz-zByzwMetnND4,15473
|
|
68
|
+
unifi_network_maps/render/lldp_md.py,sha256=Eg5c5SWEwTfEn6AN0fOfD3f41GlsqwZQRO8AzIXFQf4,10753
|
|
69
|
+
unifi_network_maps/render/mermaid.py,sha256=IqHgTqXVzHzcWwypwBfPqKx1L5QxLrjEgDiooAvE6HU,9286
|
|
69
70
|
unifi_network_maps/render/mermaid_theme.py,sha256=QReSBFoYSIz7vgAwyHx-9f4ucbSgMTGvo1Ffa2ZfzDQ,1527
|
|
70
|
-
unifi_network_maps/render/svg.py,sha256=
|
|
71
|
+
unifi_network_maps/render/svg.py,sha256=RHmSmlKxrS8m3-zYsTJu-GZugsZt8X8TDsPpK7DA6tg,38807
|
|
71
72
|
unifi_network_maps/render/svg_theme.py,sha256=Si1ArM3v_-wAvHZyLFPiOZ0ohQRd6ezIckwC3_b-WIw,2684
|
|
72
73
|
unifi_network_maps/render/theme.py,sha256=-cPvj9dfmOpBD3Ohpye_yTBWxXtsE0-g73mekqoh5kA,3606
|
|
73
|
-
unifi_network_maps-1.4.
|
|
74
|
-
unifi_network_maps-1.4.
|
|
75
|
-
unifi_network_maps-1.4.
|
|
76
|
-
unifi_network_maps-1.4.
|
|
77
|
-
unifi_network_maps-1.4.
|
|
78
|
-
unifi_network_maps-1.4.
|
|
74
|
+
unifi_network_maps-1.4.2.dist-info/licenses/LICENSE,sha256=mYo1siIIfIwyfdOuK2-Zt0ij2xBTii2hnpeTu79nD80,1074
|
|
75
|
+
unifi_network_maps-1.4.2.dist-info/METADATA,sha256=GcoBldeKBD7f9fRhpf7RZYpvTFY7MU7Fvi3uCSmai9U,9529
|
|
76
|
+
unifi_network_maps-1.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
77
|
+
unifi_network_maps-1.4.2.dist-info/entry_points.txt,sha256=cdJ7jsBgNgHxSflYUOqgz5BbvuM0Nnh-x8_Hbyh_LFg,67
|
|
78
|
+
unifi_network_maps-1.4.2.dist-info/top_level.txt,sha256=G0rUX1PNfVCn1u-KtB6QjFQHopCOVLnPMczvPOoraHg,19
|
|
79
|
+
unifi_network_maps-1.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|