Skip to main content

A loose python wrapper around the ZoneMinder REST API.

Project description

Zm-py

image

Python package

image

license

A loose python wrapper around the ZoneMinder API. As time goes on additional functionality will be added to this API client.

Acknowledgments

Not to be confused with ZoneMinder's Pythonic wrapper pyzm, this zm-py project (with a hyphen) is tailored for the Home Assistant ZoneMinder Integration

zm-py is based on code that was originally part of Home Assistant. Historical sources and authorship information is available as part of the Home Assistant project:

Installation

PyPI

pip install zm-py

Usage

from zoneminder.zm import ZoneMinder

SERVER_HOST = "{{host}}:{{port}}"
USER = "{{user}}"
PASS = "{{pass}}"
SERVER_PATH = "{{path}}"

zm_client = ZoneMinder(
    server_host=SERVER_HOST,
    server_path=SERVER_PATH,
    username=USER,
    password=PASS,
    verify_ssl=False
)

# Zoneminder authentication
zm_client.login()


# Get all monitors
monitors = zm_client.get_monitors()

for monitor in monitors:
    print(monitor)

>>> Monitor(id='monitor_id', name='monitor_name', controllable='is_controllable')


# Move camera down
controllable_monitors = [m for m in monitors if m.controllable]

for monitor in controllable_monitors:
    zm_client.move_monitor(monitor, "right")

Project details


Download files

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

Source Distribution

zm_py-0.5.4.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

zm_py-0.5.4-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file zm_py-0.5.4.tar.gz.

File metadata

  • Download URL: zm_py-0.5.4.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.1.57-gentoo-x86_64

File hashes

Hashes for zm_py-0.5.4.tar.gz
Algorithm Hash digest
SHA256 de8c89731034dc7f50814c2f8b94640324462cf43ef820ae914c98fa0df3988b
MD5 ab3805ba695b674d6adf6119fc58e46b
BLAKE2b-256 b6204fc727c6661b22e4b8fb81e9da9f3a77a458b51789d42c329b20397f4d94

See more details on using hashes here.

File details

Details for the file zm_py-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: zm_py-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.1.57-gentoo-x86_64

File hashes

Hashes for zm_py-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6dab7f725db383a7ca50f8152b554f3ad19abc7b620319d514a3b8871de1a6d8
MD5 d8c49e23337131a3cb3c76a64bc69750
BLAKE2b-256 de2dc165a35a881a1d16940c56dba9ea2b13c24e4c008702acf2d479ae0ec9d2

See more details on using hashes here.

Supported by

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