Skip to main content

ZoneMinder API, Logger and other base utilities for python programmers

Project description

What

Pythonic ZoneMinder wrapper

  • API
  • Event Server
  • Logger
  • Memory
  • Machine Learning Modules

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

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 pip install pytest --break-system-packages
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 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 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 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

  • Only for Python3

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzm-2.0.4.tar.gz (96.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzm-2.0.4-py3-none-any.whl (114.2 kB view details)

Uploaded Python 3

File details

Details for the file pyzm-2.0.4.tar.gz.

File metadata

  • Download URL: pyzm-2.0.4.tar.gz
  • Upload date:
  • Size: 96.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyzm-2.0.4.tar.gz
Algorithm Hash digest
SHA256 a46de212b19c7448b399bbefde1365d94eaf51bad6b2f2fb5680a0640bc65158
MD5 ff98aa6523fb4174c3b753316f0705d1
BLAKE2b-256 a2cf02b7a1a94f2199f0f9a9ad6f2e44f19ba71d9550a0f4af34fc572e4303e5

See more details on using hashes here.

File details

Details for the file pyzm-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyzm-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 114.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyzm-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 47642fa87223f7a24b3a6504c37c97d71e668bd1eff87bb136108c7ac8904d6a
MD5 adf800728d43a7afd7b3e5371be3b573
BLAKE2b-256 a917618fb61f08334e5dfb9fef872bda2efdedbe927f6321663583a2f1b7f507

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page