Skip to main content

What

pyzmNg is a rewrite of pyzm.

It's a pythonic wrapper that integrates with ZM and also operates as a standalone ML library. Key features:

  • ZM API
  • ZM EventServerNg
  • ZM Logger
  • ZM Memory
  • Machine Learning Modules (with our without ZM)

Installation

See the installation guide on ReadTheDocs.

Documentation & Examples

Latest documentation is available here. The documentation includes a full example.

Features

  • API auth using tokens or legacy (manages refresh logins automatically)
  • Monitors
  • Events with filters
  • States
  • Configs
  • EventNotification callbacks
  • Mapped Memory access
  • Direct access to ML algorithms
  • Remote ML detection server (pyzm.serve) — run models on a GPU box, detect from anywhere
  • Amazon Rekognition support for object detection

Training UI

pyzm includes a Streamlit-based UI for fine-tuning YOLO models on your own data:

/opt/zoneminder/venv/bin/python -m streamlit run pyzm/train/app.py -- --base-path /var/lib/zmeventnotification/models

The --base-path flag points to your ZoneMinder models directory (defaults to /var/lib/zmeventnotification/models). Projects are stored in ~/.pyzm/training/.

Testing

pyzm has three test tiers:

Unit / integration tests (no hardware required):

pip install pytest
python -m pytest tests/ -m "not e2e and not zm_e2e" -v

ML end-to-end tests (require real ML models on disk):

# Requires models in /var/lib/zmeventnotification/models/
# and the test image at tests/test_ml_e2e/bird.jpg (included in repo)
python -m pytest tests/test_ml_e2e/ -v

# Skip the slower remote-serve tests:
python -m pytest tests/test_ml_e2e/ -v -m "not serve"

ZoneMinder end-to-end tests (require a live ZM server):

One-time setup:

sudo /opt/zoneminder/venv/bin/pip install pytest
cp tests/.env.zm_e2e.sample .env.zm_e2e   # edit with your ZM server details
# Readonly tests (auth, monitors, events, zones, frames, detection):
sudo -u www-data /opt/zoneminder/venv/bin/python -m pytest tests/test_zm_e2e/ -v -p no:cacheprovider

# Include write tests (event notes, stop/start/restart, DB tagging):
sudo -u www-data ZM_E2E_WRITE=1 /opt/zoneminder/venv/bin/python -m pytest tests/test_zm_e2e/ -v -p no:cacheprovider

ZM E2E tests auto-skip when .env.zm_e2e is missing, so pytest tests/ is always safe.

Developer Notes (for myself)

To make a release:

./scripts/make_release.sh

To skip PyPI upload (e.g. package already published):

./scripts/make_release.sh --skip-pypi

To test docs:

cd docs/
make html && python -m http.server -d _build/html

To test a CHANGELOG:

# __version__ in pyzm/__init__.py should be updated
# replace v2.0.3 with whatever future version
GITHUB_TOKEN=$(gh auth token) git-cliff --tag "v2.0.3"

Limitations

  • Requires Python 3.10+

Metadata

Release files for pyzm 2.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyzm 2.5.5
File Size Uploaded Provenance
pyzm-2.5.5.tar.gz 529.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyzm 2.5.5
File Interpreter ABI Platform
pyzm-2.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 951.7 kB

Release files / pyzm-2.5.5.tar.gz

Download URL pyzm-2.5.5.tar.gz
Size 529.7 kB
Tags Source
SHA-256 checksum
How to use checksums
83d20274c2b9725b054b2586bb548e9badd50add4d1e7eb8a0b35c0af44624fb
BLAKE2b-256 checksum
How to use checksums
9ef2dad2f88d2e0fd78d45febe02b3dab54b64e59d5a22ea25a99acb2ef51719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pyzm-2.5.5-py3-none-any.whl

Download URL pyzm-2.5.5-py3-none-any.whl
Size 422.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61a6b74863090c0054361c324f9a1b07c9612e52a066db3054ecacd6678fa830
BLAKE2b-256 checksum
How to use checksums
d059537962544117522e3819f646ef6f0e8dd2f3984405a9dc375a1d33bd2887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for pyzm 2.5.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.5.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page