How baqs/pyezviz works
Project type and purpose
• This is an open-source Python CLI/library package (pyezvizapi) that wraps the undocumented Ezviz IoT camera/light-bulb REST/MQTT/RTSP APIs.
• Its purpose is to allow users (via CLI or programmatic import) to authenticate with Ezviz, list devices, query status, toggle lights, and stream or fetch RTSP camera feeds.
File structure
• Top-level:
• setup.py, requirements.txt, MANIFEST.in ⇒ packaging & dependencies
• README.md, LICENSE.md ⇒ documentation
• .github/ ⇒ CI/CD workflows (PyPI publishing)
• examples/ ⇒ sample usage
• pyezvizapi/ (core library):
• __main__.py ⇒ CLI entrypoint (click/argparse)
• client.py ⇒ orchestrates auth + requests
• api_endpoints.py ⇒ URL definitions for REST calls
• camera.py, light_bulb.py, cas.py ⇒ device-specific logic
• mqtt.py ⇒ MQTT broker connection for real-time events
• utils.py ⇒ JSON parsing, signing, encryption
• constants.py ⇒ mappings (switch numbers → names)
• exceptions.py ⇒ error classes
• tests/ (not shown above but referred in README) ⇒ pytest/tox suite and sample JSON in tests/data/.
README for insights
• CLI commands: pyezvizapi -u USER -p PASS [devices/camera/light] [status/toggle]
• Under the hood: HTTP(S) to EzvizLife API servers, optionally RTSP for live streams, MQTT for push events.
• Region override (–r) for alternative base URLs.
• No official docs; endpoints reverse-engineered.