unifi-network-maps 1.4.1__tar.gz → 1.4.3__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.
Files changed (113) hide show
  1. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/CHANGELOG.md +30 -7
  2. unifi_network_maps-1.4.3/CONTRIBUTING.md +89 -0
  3. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/PKG-INFO +57 -82
  4. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/README.md +53 -80
  5. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/pyproject.toml +15 -3
  6. unifi_network_maps-1.4.3/src/unifi_network_maps/__init__.py +1 -0
  7. unifi_network_maps-1.4.3/src/unifi_network_maps/adapters/unifi.py +457 -0
  8. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/themes/dark.yaml +3 -0
  9. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/cli/main.py +352 -107
  10. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/io/debug.py +15 -5
  11. unifi_network_maps-1.4.3/src/unifi_network_maps/io/export.py +32 -0
  12. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/model/topology.py +125 -71
  13. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/device_ports_md.py +31 -18
  14. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/lldp_md.py +87 -43
  15. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/mermaid.py +105 -49
  16. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/mermaid_theme.py +15 -5
  17. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/svg.py +614 -318
  18. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/theme.py +19 -0
  19. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/PKG-INFO +57 -82
  20. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/SOURCES.txt +2 -0
  21. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/requires.txt +3 -1
  22. unifi_network_maps-1.4.3/tests/test_contract_unifi.py +78 -0
  23. unifi_network_maps-1.4.3/tests/test_contract_unifi_live.py +71 -0
  24. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_mermaid.py +10 -0
  25. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_svg.py +48 -49
  26. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_topology.py +16 -0
  27. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_unifi.py +100 -16
  28. unifi_network_maps-1.4.1/CONTRIBUTING.md +0 -26
  29. unifi_network_maps-1.4.1/src/unifi_network_maps/__init__.py +0 -1
  30. unifi_network_maps-1.4.1/src/unifi_network_maps/adapters/unifi.py +0 -215
  31. unifi_network_maps-1.4.1/src/unifi_network_maps/io/export.py +0 -13
  32. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/LICENSE +0 -0
  33. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/LICENSES.md +0 -0
  34. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/MANIFEST.in +0 -0
  35. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/RELEASING.md +0 -0
  36. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/SECURITY.md +0 -0
  37. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/setup.cfg +0 -0
  38. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/__main__.py +0 -0
  39. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/adapters/__init__.py +0 -0
  40. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/adapters/config.py +0 -0
  41. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/__init__.py +0 -0
  42. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/__init__.py +0 -0
  43. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/access-point.svg +0 -0
  44. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/ISOPACKS_LICENSE +0 -0
  45. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/block.svg +0 -0
  46. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/cache.svg +0 -0
  47. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/cardterminal.svg +0 -0
  48. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/cloud.svg +0 -0
  49. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/cronjob.svg +0 -0
  50. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/cube.svg +0 -0
  51. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/desktop.svg +0 -0
  52. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/diamond.svg +0 -0
  53. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/dns.svg +0 -0
  54. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/document.svg +0 -0
  55. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/firewall.svg +0 -0
  56. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/function-module.svg +0 -0
  57. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/image.svg +0 -0
  58. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/laptop.svg +0 -0
  59. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/loadbalancer.svg +0 -0
  60. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/lock.svg +0 -0
  61. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/mail.svg +0 -0
  62. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/mailmultiple.svg +0 -0
  63. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/mobiledevice.svg +0 -0
  64. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/office.svg +0 -0
  65. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/package-module.svg +0 -0
  66. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/paymentcard.svg +0 -0
  67. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/plane.svg +0 -0
  68. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/printer.svg +0 -0
  69. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/pyramid.svg +0 -0
  70. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/queue.svg +0 -0
  71. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/router.svg +0 -0
  72. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/server.svg +0 -0
  73. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/speech.svg +0 -0
  74. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/sphere.svg +0 -0
  75. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/storage.svg +0 -0
  76. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/switch-module.svg +0 -0
  77. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/tower.svg +0 -0
  78. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/truck-2.svg +0 -0
  79. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/truck.svg +0 -0
  80. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/user.svg +0 -0
  81. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/isometric/vm.svg +0 -0
  82. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/laptop.svg +0 -0
  83. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/router-network.svg +0 -0
  84. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/server-network.svg +0 -0
  85. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/icons/server.svg +0 -0
  86. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/assets/themes/default.yaml +0 -0
  87. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/cli/__init__.py +0 -0
  88. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/cli/__main__.py +0 -0
  89. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/io/__init__.py +0 -0
  90. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/io/mock_data.py +0 -0
  91. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/io/mock_generate.py +0 -0
  92. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/model/__init__.py +0 -0
  93. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/model/labels.py +0 -0
  94. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/model/lldp.py +0 -0
  95. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/model/ports.py +0 -0
  96. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/__init__.py +0 -0
  97. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps/render/svg_theme.py +0 -0
  98. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/dependency_links.txt +0 -0
  99. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/entry_points.txt +0 -0
  100. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/src/unifi_network_maps.egg-info/top_level.txt +0 -0
  101. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_cli.py +0 -0
  102. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_clients.py +0 -0
  103. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_config.py +0 -0
  104. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_debug.py +0 -0
  105. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_device_ports_md.py +0 -0
  106. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_export.py +0 -0
  107. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_groups.py +0 -0
  108. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_labels.py +0 -0
  109. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_lldp.py +0 -0
  110. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_lldp_md.py +0 -0
  111. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_mock_generate.py +0 -0
  112. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_svg_iso.py +0 -0
  113. {unifi_network_maps-1.4.1 → unifi_network_maps-1.4.3}/tests/test_theme.py +0 -0
@@ -2,7 +2,30 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## v1.4.0
5
+ ## v1.4.3 - (unreleased)
6
+ - planned: POC for HA integration
7
+
8
+ ## v1.4.2 - 2026-01-10
9
+ - Added static code analysis and stricter type-checking
10
+ - Added contract tests for UniFi API wrapper with fixture-based validation.
11
+ - Added optional live UniFi contract tests (gated by `UNIFI_CONTRACT_LIVE=1`).
12
+ - Split CI into dedicated jobs and added a contract-test job.
13
+ - Added Behave-based BDD tests covering CLI outputs, mkdocs assets, and error handling.
14
+ - Added mkdocs timestamp (timezone configurable via `--mkdocs-timestamp-zone`).
15
+ - Added optional dual Mermaid blocks for MkDocs Material theme switching (`--mkdocs-dual-theme`).
16
+ - Switched UniFi API cache payloads to JSON for safer local storage.
17
+ - Skips cache usage when the cache directory is group/world-writable.
18
+ - Added `--no-cache` to bypass UniFi API cache reads/writes.
19
+ - Added file locking around cache read/write operations to avoid concurrent corruption.
20
+ - Hardened Mermaid label escaping for newlines and backslashes.
21
+ - Fixed device cache serialization to preserve LLDP data when caching.
22
+ - Added optional UniFi API request timeouts via `UNIFI_REQUEST_TIMEOUT_SECONDS`.
23
+ - Made `--output` writes atomic to avoid partial files on interruption.
24
+
25
+ ## v1.4.1 - 2026-01-06
26
+ - pip install was broken, fixed.
27
+
28
+ ## v1.4.0 - 2026-01-06
6
29
  - Added MkDocs output, which includes gateway/switch details and per-port tables.
7
30
  - Port tables show speed, PoE status, power, and wired clients per port.
8
31
  - Added compact legend with sidebar injection (`--mkdocs-sidebar-legend`).
@@ -15,14 +38,14 @@ All notable changes to this project will be documented in this file.
15
38
  - Added Faker-powered `--generate-mock` for deterministic mock fixtures (dev-only).
16
39
  - Added mock fixtures + SVG/Mermaid examples, with mock smoketest/CI steps.
17
40
 
18
- ## v1.3.1
41
+ ## v1.3.1 - 2026-01-04
19
42
  - Added `lldp-md` output with per-device details tables and optional client sections.
20
43
  - Added `--client-scope wired|wireless|all` and dashed wireless client links in Mermaid/SVG.
21
44
  - Expanded smoketest outputs for wireless/all client scopes and LLDP markdown.
22
45
  - Fixed SVG icon loading paths after package reorg.
23
46
  - Tuned isometric port label placement on front tiles.
24
47
 
25
- ## v1.3.0
48
+ ## v1.3.0 - 2026-01-04
26
49
  - Reorganized package into submodules (`adapters/`, `model/`, `render/`, `io/`, `cli/`).
27
50
  - YAML-based theming with default + dark themes and `--theme-file`.
28
51
  - CLI help now grouped by category; CLI logic split into focused helpers.
@@ -31,13 +54,13 @@ All notable changes to this project will be documented in this file.
31
54
  - Added PoE/edge/device count logging and improved label ordering helpers.
32
55
  - Coverage excludes asset packages; docs updated (options/groups + AI disclosure).
33
56
 
34
- ## v1.2.4
57
+ ## v1.2.4 - 2026-01-03
35
58
  - Added typed `UplinkInfo`/`PortInfo` and uplink fallback for LLDP gaps.
36
59
  - Deterministic edge ordering for repeatable output.
37
60
  - CI publish workflow (trusted publishing) and release docs.
38
61
  - Project metadata and packaging updated for OSS readiness.
39
62
 
40
- ## v1.1.0
63
+ ## v1.1.0 - 2026-01-03
41
64
  - Added isometric SVG output with grid-aligned links and isometric icon set.
42
65
  - Improved port label placement and client labeling in SVG outputs.
43
66
  - Added smoketest target with multiple outputs (ports/clients/legend).
@@ -45,14 +68,14 @@ All notable changes to this project will be documented in this file.
45
68
  - Fixed Mermaid legend/grouped output parsing errors.
46
69
  - Refined visuals: link gradients, tile gradients, icon placement tweaks.
47
70
 
48
- ## v1.0.0
71
+ ## v1.0.0 - 2025-12-30
49
72
  - Mermaid legend can render as a separate graph.
50
73
  - Straight Mermaid links with node type coloring.
51
74
  - Added wired client leaf nodes and uplink port labels.
52
75
  - Expanded PoE detection tests and LLDP helpers.
53
76
  - CLI loads `.env` automatically.
54
77
 
55
- ## v0.2.0
78
+ ## v0.2.0 - 2026-01-02 - Initial public release
56
79
  - Added versioning workflow and bump tooling.
57
80
  - Introduced SVG renderer and tree layout fixes.
58
81
  - Increased test coverage and added coverage tooling.
@@ -0,0 +1,89 @@
1
+ # Contributing
2
+
3
+ Thanks for considering a contribution!
4
+
5
+ ## Development setup
6
+
7
+ ```bash
8
+ python -m venv .venv
9
+ source .venv/bin/activate
10
+ pip install -r requirements-build.txt
11
+ pip install -r requirements-dev.txt -c constraints.txt
12
+ pre-commit install
13
+ ```
14
+
15
+ Editable install:
16
+
17
+ ```bash
18
+ pip install -e .
19
+ ```
20
+
21
+ Local install check (non-editable):
22
+
23
+ ```bash
24
+ pip install .
25
+ ```
26
+
27
+ ## Running checks
28
+
29
+ ```bash
30
+ ruff check .
31
+ pyright
32
+ pytest
33
+ behave
34
+ ```
35
+
36
+ Or run everything with:
37
+
38
+ ```bash
39
+ make ci
40
+ ```
41
+
42
+ Notes:
43
+ - Contract tests use fixtures in `tests/test_contract_unifi.py` and run in CI.
44
+ - Live contract tests require `UNIFI_CONTRACT_LIVE=1` plus UniFi env vars.
45
+ - BDD tests live in `features/` and run via `behave` (included in `make ci`).
46
+
47
+ ## Release
48
+
49
+ Build and upload to PyPI:
50
+
51
+ ```bash
52
+ python -m pip install build twine
53
+ python -m build
54
+ twine upload dist/*
55
+ ```
56
+
57
+ Tagging is recommended before release:
58
+
59
+ ```bash
60
+ git tag -a vX.Y.Z -m "vX.Y.Z"
61
+ git push origin vX.Y.Z
62
+ ```
63
+
64
+ See `LICENSES.md` for third-party license info.
65
+
66
+ ## Guidelines
67
+
68
+ - Keep changes focused and small.
69
+ - Add or update tests where behavior changes.
70
+ - Run `make ci` before opening a PR.
71
+
72
+ ## Is there value in this project?
73
+
74
+ What exists today:
75
+
76
+ - UniFi UI topology view: great live map, but not exportable, not automatable, and not Mermaid/SVG.
77
+ - Mermaid/Graphviz tools: diagramming, but no UniFi data ingestion or LLDP/topology logic.
78
+ - UniFi API wrappers: data access only, no rendering/export pipelines.
79
+ - NetBox/Grafana/HA cards: broader infra tooling, but not focused on UniFi LLDP + publishable diagrams.
80
+
81
+ What’s distinctive here:
82
+
83
+ - Automated UniFi → Mermaid/SVG (incl. isometric) output, with ports/PoE/clients.
84
+ - Deterministic CLI + cache + mock generator for CI and docs.
85
+ - MkDocs/Markdown output plus planned HA‑friendly artifacts.
86
+ - A clean render pipeline that can power multiple export targets.
87
+
88
+ So we’re not duplicating a packaged workflow; we’re combining data + topology modeling + diagram output + documentation/export in a way I haven’t seen in one place.
89
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unifi-network-maps
3
- Version: 1.4.1
3
+ Version: 1.4.3
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: ruff==0.14.10; extra == "dev"
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
- Dynamic UniFi -> Mermaid network maps generated from LLDP topology.
38
+ [![CI](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/ci.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/ci.yml)
39
+ [![CodeQL](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/codeql.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/codeql.yml)
40
+ [![Publish](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/publish.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/publish.yml)
41
+ [![PyPI](https://img.shields.io/pypi/v/unifi-network-maps.svg)](https://pypi.org/project/unifi-network-maps/)
37
42
 
38
- ## Setup
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
- - Python >= 3.13
41
- - Virtualenv required
46
+ ## Installation
47
+
48
+ PyPI:
42
49
 
43
50
  ```bash
44
- python -m venv .venv
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
- Local install (non-editable):
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
- ## Usage
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
- # Single-page MkDocs output (ports included, no clients)
106
- unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
116
+ MkDocs output (ports included, no clients):
107
117
 
108
- # MkDocs output (map + legend + gateway/switch port tables)
118
+ ```bash
109
119
  unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
120
+ ```
110
121
 
111
- # Include wired clients in the port tables
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
- SVG size overrides:
128
+ MkDocs output with dual Mermaid blocks for Material theme switching:
116
129
 
117
130
  ```bash
118
- unifi-network-maps --format svg --svg-width 1400 --svg-height 900 --output ./network.svg
131
+ unifi-network-maps --format mkdocs --mkdocs-dual-theme --output ./docs/unifi-network.md
132
+ ```
119
133
 
120
- # LLDP tables for troubleshooting
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
  ![Isometric network example](examples/output/network_ports_clients_iso.svg)
@@ -170,50 +184,14 @@ graph TB
170
184
  linkStyle 1 stroke:#1e88e5,stroke-width:2px,arrowhead:none;
171
185
  ```
172
186
 
173
- ## Local install check
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
- ```bash
209
- pip install unifi-network-maps
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
- Then run:
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
- ## MkDocs Material example
268
+ ## Notes
301
269
 
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.
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
- The built-in themes live at `src/unifi_network_maps/assets/themes/default.yaml` and
306
- `src/unifi_network_maps/assets/themes/dark.yaml`.
278
+
279
+ ## AI Disclosure
280
+
281
+ This project used OpenAI Codex as a coding assistant for portions of the implementation and documentation.
@@ -1,22 +1,27 @@
1
1
  # unifi-network-maps
2
2
 
3
- Dynamic UniFi -> Mermaid network maps generated from LLDP topology.
3
+ [![CI](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/ci.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/ci.yml)
4
+ [![CodeQL](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/codeql.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/codeql.yml)
5
+ [![Publish](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/publish.yml/badge.svg)](https://github.com/merlijntishauser/unifi-network-maps/actions/workflows/publish.yml)
6
+ [![PyPI](https://img.shields.io/pypi/v/unifi-network-maps.svg)](https://pypi.org/project/unifi-network-maps/)
4
7
 
5
- ## Setup
8
+ Dynamic UniFi network maps generated from LLDP topology. Output can be a range of options including Markdown,
9
+ Mermaid, SVG (including an Isometric view), and MkDocs.
6
10
 
7
- - Python >= 3.13
8
- - Virtualenv required
11
+ ## Installation
12
+
13
+ PyPI:
9
14
 
10
15
  ```bash
11
- python -m venv .venv
12
- source .venv/bin/activate
13
- pip install -r requirements-build.txt
14
- pip install -e . -c constraints.txt
16
+ pip install unifi-network-maps
15
17
  ```
16
18
 
17
- Local install (non-editable):
19
+ From source:
18
20
 
19
21
  ```bash
22
+ python -m venv .venv
23
+ source .venv/bin/activate
24
+ pip install -r requirements-build.txt
20
25
  pip install .
21
26
  ```
22
27
 
@@ -30,6 +35,7 @@ export UNIFI_SITE=default
30
35
  export UNIFI_USER=local_admin
31
36
  export UNIFI_PASS=********
32
37
  export UNIFI_VERIFY_SSL=false
38
+ export UNIFI_REQUEST_TIMEOUT_SECONDS=10
33
39
  ```
34
40
 
35
41
  Use a custom env file:
@@ -38,7 +44,7 @@ Use a custom env file:
38
44
  unifi-network-maps --env-file ./site.env --stdout
39
45
  ```
40
46
 
41
- ## Usage
47
+ ## Quickstart
42
48
 
43
49
  Basic map (tree layout by LLDP hops):
44
50
 
@@ -52,6 +58,8 @@ Write Markdown for notes tools:
52
58
  unifi-network-maps --markdown --output ./network.md
53
59
  ```
54
60
 
61
+ ## Usage
62
+
55
63
  Show ports + clients:
56
64
 
57
65
  ```bash
@@ -68,23 +76,29 @@ Isometric SVG output:
68
76
 
69
77
  ```bash
70
78
  unifi-network-maps --format svg-iso --output ./network.svg
79
+ ```
71
80
 
72
- # Single-page MkDocs output (ports included, no clients)
73
- unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
81
+ MkDocs output (ports included, no clients):
74
82
 
75
- # MkDocs output (map + legend + gateway/switch port tables)
83
+ ```bash
76
84
  unifi-network-maps --format mkdocs --output ./docs/unifi-network.md
85
+ ```
77
86
 
78
- # Include wired clients in the port tables
87
+ MkDocs output with clients:
88
+
89
+ ```bash
79
90
  unifi-network-maps --format mkdocs --include-clients --output ./docs/unifi-network.md
80
91
  ```
81
92
 
82
- SVG size overrides:
93
+ MkDocs output with dual Mermaid blocks for Material theme switching:
83
94
 
84
95
  ```bash
85
- unifi-network-maps --format svg --svg-width 1400 --svg-height 900 --output ./network.svg
96
+ unifi-network-maps --format mkdocs --mkdocs-dual-theme --output ./docs/unifi-network.md
97
+ ```
86
98
 
87
- # LLDP tables for troubleshooting
99
+ LLDP tables for troubleshooting:
100
+
101
+ ```bash
88
102
  unifi-network-maps --format lldp-md --output ./lldp.md
89
103
  ```
90
104
 
@@ -109,9 +123,7 @@ unifi-network-maps --generate-mock examples/mock_data.json --mock-seed 1337
109
123
  Generate the isometric SVG:
110
124
 
111
125
  ```bash
112
- unifi-network-maps --mock-data examples/mock_data.json \
113
- --include-ports --include-clients --format svg-iso \
114
- --output examples/output/network_ports_clients_iso.svg
126
+ unifi-network-maps --mock-data examples/mock_data.json --include-ports --include-clients --format svg-iso --output examples/output/network_ports_clients_iso.svg
115
127
  ```
116
128
 
117
129
  ![Isometric network example](examples/output/network_ports_clients_iso.svg)
@@ -137,50 +149,14 @@ graph TB
137
149
  linkStyle 1 stroke:#1e88e5,stroke-width:2px,arrowhead:none;
138
150
  ```
139
151
 
140
- ## Local install check
141
-
142
- ```bash
143
- pip install .
144
- ```
145
-
146
- ## Dev
147
-
148
- ```bash
149
- pip install -r requirements-dev.txt -c constraints.txt
150
- ```
151
-
152
- ## Release
153
-
154
- Build and upload to PyPI:
155
-
156
- ```bash
157
- python -m pip install build twine
158
- python -m build
159
- twine upload dist/*
160
- ```
161
-
162
- Tagging is recommended before release:
163
-
164
- ```bash
165
- git tag -a vX.Y.Z -m "vX.Y.Z"
166
- git push origin vX.Y.Z
167
- ```
168
-
169
- See `LICENSES.md` for third-party license info.
170
-
171
- ## Installation
172
-
173
- PyPI: https://pypi.org/project/unifi-network-maps/
152
+ ## MkDocs Material example
174
153
 
175
- ```bash
176
- pip install unifi-network-maps
177
- ```
154
+ See `examples/mkdocs/` for a ready-to-use setup that renders Mermaid diagrams
155
+ with Material for MkDocs, including a sample `unifi-network` page and legend.
178
156
 
179
- Then run:
157
+ The built-in themes live at `src/unifi_network_maps/assets/themes/default.yaml` and
158
+ `src/unifi_network_maps/assets/themes/dark.yaml`.
180
159
 
181
- ```bash
182
- unifi-network-maps --help
183
- ```
184
160
 
185
161
  ## Options
186
162
 
@@ -190,6 +166,7 @@ Source:
190
166
  - `--site`: override `UNIFI_SITE`.
191
167
  - `--env-file`: load environment variables from a specific `.env` file.
192
168
  - `--mock-data`: use mock data JSON instead of the UniFi API.
169
+
193
170
  Mock:
194
171
  - `--generate-mock`: write mock data JSON and exit.
195
172
  - `--mock-seed`: seed for deterministic mock generation.
@@ -203,6 +180,7 @@ Functional:
203
180
  - `--include-clients`: add active wired clients as leaf nodes.
204
181
  - `--client-scope wired|wireless|all`: which client types to include (default wired).
205
182
  - `--only-unifi`: only include neighbors that are UniFi devices.
183
+ - `--no-cache`: disable UniFi API cache reads and writes.
206
184
 
207
185
  Mermaid:
208
186
  - `--direction LR|TB`: diagram direction for Mermaid (default TB).
@@ -220,25 +198,13 @@ Output:
220
198
  - `--stdout`: write output to stdout.
221
199
  - `--markdown`: wrap Mermaid output in a code fence.
222
200
  - `--mkdocs-sidebar-legend`: write assets to place the compact legend in the MkDocs right sidebar.
201
+ - `--mkdocs-dual-theme`: render light/dark Mermaid blocks for Material theme switching.
202
+ - `--mkdocs-timestamp-zone`: timezone for mkdocs timestamp (`Europe/Amsterdam` default; use `off` to disable).
223
203
 
224
204
  Debug:
225
205
  - `--debug-dump`: dump gateway + sample devices to stderr for debugging.
226
206
  - `--debug-sample N`: number of non-gateway devices in debug dump (default 2).
227
207
 
228
- ## Notes
229
-
230
- - Default output is top-to-bottom (TB) and rendered as a hop-based tree from the gateway(s).
231
- - Nodes are color-coded by type (gateway/switch/AP/client) with a sensible default palette.
232
- - PoE links are highlighted in blue and annotated with a power icon when detected from `port_table`.
233
- - Wireless client links render as dashed lines to indicate the last-known upstream.
234
- - SVG output uses vendored device glyphs from `src/unifi_network_maps/assets/icons`.
235
- - Isometric SVG output uses MIT-licensed icons from `markmanx/isopacks`.
236
- - SVG port labels render inside child nodes for readability.
237
-
238
- ## AI Disclosure
239
-
240
- This project used OpenAI Codex as a coding assistant for portions of the implementation and documentation.
241
-
242
208
  ## Theme file
243
209
 
244
210
  Example theme YAML (override only the values you want):
@@ -264,10 +230,17 @@ svg:
264
230
  to: "#b6dcff"
265
231
  ```
266
232
 
267
- ## MkDocs Material example
233
+ ## Notes
268
234
 
269
- See `examples/mkdocs/` for a ready-to-use setup that renders Mermaid diagrams
270
- with Material for MkDocs, including a sample `unifi-network` page and legend.
235
+ - Default output is top-to-bottom (TB) and rendered as a hop-based tree from the gateway(s).
236
+ - Nodes are color-coded by type (gateway/switch/AP/client) with a sensible default palette.
237
+ - PoE links are highlighted in blue and annotated with a power icon when detected from `port_table`.
238
+ - Wireless client links render as dashed lines to indicate the last-known upstream.
239
+ - SVG output uses vendored device glyphs from `src/unifi_network_maps/assets/icons`.
240
+ - Isometric SVG output uses MIT-licensed icons from `markmanx/isopacks`.
241
+ - SVG port labels render inside child nodes for readability.
271
242
 
272
- The built-in themes live at `src/unifi_network_maps/assets/themes/default.yaml` and
273
- `src/unifi_network_maps/assets/themes/dark.yaml`.
243
+
244
+ ## AI Disclosure
245
+
246
+ This project used OpenAI Codex as a coding assistant for portions of the implementation and documentation.