# Zm-py
[![image](https://badge.fury.io/py/zm-py.svg)](https://badge.fury.io/py/zm-py/)
[![Python package](https://github.com/rohankapoorcom/zm-py/actions/workflows/python-qa.yml/badge.svg)](https://github.com/rohankapoorcom/zm-py/actions/workflows/python-qa.yml)
[![image](https://img.shields.io/pypi/pyversions/zm-py.svg)](https://pypi.python.org/pypi/zm-py)
[![license](https://img.shields.io/github/license/rohankapoorcom/zm-py.svg?style=flat-square)](https://github.com/rohankapoorcom/zm-py/blob/master/LICENSE.md)
A loose python wrapper around the [ZoneMinder](https://www.zoneminder.org) 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](https://github.com/ZoneMinder/pyzm),
this zm-py project (with a hyphen) is tailored for the [Home Assistant ZoneMinder Integration](https://www.home-assistant.io/integrations/zoneminder/)
zm-py is based on code that was originally part of [Home Assistant](https://www.home-assistant.io).
Historical sources and authorship information is available as part of the Home Assistant project:
- [ZoneMinder Platform](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/zoneminder.py)
- [ZoneMinder Camera](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/camera/zoneminder.py)
- [ZoneMinder Sensor](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/sensor/zoneminder.py)
- [ZoneMinder Switch](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/switch/zoneminder.py)
## Installation
### PyPI
```bash
pip install zm-py
```
## Usage
```python
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")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rohankapoorcom/zm-py",
"name": "zm-py",
"maintainer": "Nic Boet",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "nic@boet.cc",
"keywords": "",
"author": "Rohan Kapoor",
"author_email": "rohan@rohankapoor.com",
"download_url": "https://files.pythonhosted.org/packages/b6/20/4fc727c6661b22e4b8fb81e9da9f3a77a458b51789d42c329b20397f4d94/zm_py-0.5.4.tar.gz",
"platform": null,
"description": "# Zm-py\n\n[![image](https://badge.fury.io/py/zm-py.svg)](https://badge.fury.io/py/zm-py/)\n\n[![Python package](https://github.com/rohankapoorcom/zm-py/actions/workflows/python-qa.yml/badge.svg)](https://github.com/rohankapoorcom/zm-py/actions/workflows/python-qa.yml)\n\n[![image](https://img.shields.io/pypi/pyversions/zm-py.svg)](https://pypi.python.org/pypi/zm-py)\n\n[![license](https://img.shields.io/github/license/rohankapoorcom/zm-py.svg?style=flat-square)](https://github.com/rohankapoorcom/zm-py/blob/master/LICENSE.md)\n\nA loose python wrapper around the [ZoneMinder](https://www.zoneminder.org) API.\nAs time goes on additional functionality will be added to this API client.\n\n## Acknowledgments\n\nNot to be confused with ZoneMinder's Pythonic wrapper [pyzm](https://github.com/ZoneMinder/pyzm),\nthis zm-py project (with a hyphen) is tailored for the [Home Assistant ZoneMinder Integration](https://www.home-assistant.io/integrations/zoneminder/)\n\nzm-py is based on code that was originally part of [Home Assistant](https://www.home-assistant.io).\nHistorical sources and authorship information is available as part of the Home Assistant project:\n\n- [ZoneMinder Platform](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/zoneminder.py)\n- [ZoneMinder Camera](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/camera/zoneminder.py)\n- [ZoneMinder Sensor](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/sensor/zoneminder.py)\n- [ZoneMinder Switch](https://github.com/home-assistant/home-assistant/commits/dev/homeassistant/components/switch/zoneminder.py)\n\n## Installation\n\n### PyPI\n\n```bash\npip install zm-py\n```\n\n## Usage\n\n```python\nfrom zoneminder.zm import ZoneMinder\n\nSERVER_HOST = \"{{host}}:{{port}}\"\nUSER = \"{{user}}\"\nPASS = \"{{pass}}\"\nSERVER_PATH = \"{{path}}\"\n\nzm_client = ZoneMinder(\n server_host=SERVER_HOST,\n server_path=SERVER_PATH,\n username=USER,\n password=PASS,\n verify_ssl=False\n)\n\n# Zoneminder authentication\nzm_client.login()\n\n\n# Get all monitors\nmonitors = zm_client.get_monitors()\n\nfor monitor in monitors:\n print(monitor)\n\n>>> Monitor(id='monitor_id', name='monitor_name', controllable='is_controllable')\n\n\n# Move camera down\ncontrollable_monitors = [m for m in monitors if m.controllable]\n\nfor monitor in controllable_monitors:\n zm_client.move_monitor(monitor, \"right\")\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A loose python wrapper around the ZoneMinder REST API.",
"version": "0.5.4",
"project_urls": {
"Homepage": "https://github.com/rohankapoorcom/zm-py",
"Repository": "https://github.com/rohankapoorcom/zm-py"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "de2dc165a35a881a1d16940c56dba9ea2b13c24e4c008702acf2d479ae0ec9d2",
"md5": "d8c49e23337131a3cb3c76a64bc69750",
"sha256": "6dab7f725db383a7ca50f8152b554f3ad19abc7b620319d514a3b8871de1a6d8"
},
"downloads": -1,
"filename": "zm_py-0.5.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8c49e23337131a3cb3c76a64bc69750",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 12887,
"upload_time": "2024-01-08T03:52:36",
"upload_time_iso_8601": "2024-01-08T03:52:36.744921Z",
"url": "https://files.pythonhosted.org/packages/de/2d/c165a35a881a1d16940c56dba9ea2b13c24e4c008702acf2d479ae0ec9d2/zm_py-0.5.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b6204fc727c6661b22e4b8fb81e9da9f3a77a458b51789d42c329b20397f4d94",
"md5": "ab3805ba695b674d6adf6119fc58e46b",
"sha256": "de8c89731034dc7f50814c2f8b94640324462cf43ef820ae914c98fa0df3988b"
},
"downloads": -1,
"filename": "zm_py-0.5.4.tar.gz",
"has_sig": false,
"md5_digest": "ab3805ba695b674d6adf6119fc58e46b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 13322,
"upload_time": "2024-01-08T03:52:38",
"upload_time_iso_8601": "2024-01-08T03:52:38.316751Z",
"url": "https://files.pythonhosted.org/packages/b6/20/4fc727c6661b22e4b8fb81e9da9f3a77a458b51789d42c329b20397f4d94/zm_py-0.5.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-08 03:52:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rohankapoorcom",
"github_project": "zm-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "zm-py"
}