Name | reolink-ip JSON |
Version |
0.0.49
JSON |
| download |
home_page | |
Summary | Reolink IP NVR/camera API |
upload_time | 2023-01-05 08:59:48 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2020 JimStar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
reolink
api
camera
nvr
cctv
home-assistant
home assistant
smart home
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h2 align="center">
<a href="https://reolink.com"><img src="https://raw.githubusercontent.com/JimStar/reolink_ip/master/logo.png" width="200"></a>
<br>
<i>Reolink IP NVR/cameras API package</i>
<br>
</h2>
<p align="center">
<a href="https://pypi.org/project/reolink-ip"><img src="https://img.shields.io/pypi/dm/reolink-ip"></a>
<img src="https://img.shields.io/github/v/release/JimStar/reolink_ip?display_name=tag&include_prereleases&sort=semver" alt="Current version">
</p>
The `reolink_ip` Python package allows you to integrate your [Reolink](https://www.reolink.com/) devices (NVR/cameras) in your application.
### Description
This is a package implementing Reolink IP NVR and camera API. Also it’s providing a way to subscribe to Reolink ONVIF SWN events, so that real-time events can be received on a webhook.
### Prerequisites
- Python 3.9
### Installation
```
pip3 install reolink-ip
```
or manually:
````
git clone https://github.com/JimStar/reolink_ip
cd reolink_ip/
pip3 install .
````
### Usage
````
# Create a host-object (representing either a camera, or NVR with several channels)
host = api.Host('192.168.1.10', 80, 'user', 'mypassword')
# Obtain/cache NVR or camera settings and capabilities, like model name, ports, HDD size, etc:
await host.get_host_data()
# Get the subscribtion port and host-device name:
subscribtion_port = host.onvif_port
name = host.nvr_name
# Obtain/cache states of features:
await host.get_states()
# Print some state value on the channel with index 0:
print(host.ir_enabled(0))
# Enable the infrared lights on the channel with index 1:
await host.set_ir_lights(1, True)
# Enable the spotlight on the channel with index 1:
await host.set_spotlight(1, True)
# Enable the siren on the channel with index 0:
await host.set_siren(0, True)
# Now subscribe to events, suppose our webhook url is http://192.168.1.11/webhook123
await host.subscribe('http://192.168.1.11/webhook123')
# After some minutes check the renew timer (keep the eventing alive):
if (host.renewTimer <= 100):
await host.renew()
# Logout and disconnect
await host.disconnect()
````
### Example
This is an example of the usage of the API. In this case we want to retrive and print the Mac Address of the NVR.
````
from reolink_ip.api import Host
import asyncio
async def print_mac_address():
# initialize the host
host = Host('192.168.1.109', 80, 'admin', 'admin1234')
# connect and obtain/cache device settings and capabilities
await host.get_host_data()
# check if it is a camera or an NVR
print("It is an NVR: %s, number of channels: %s", host.is_nvr, host.num_channels)
# print mac address
print(host.mac_address)
# close the device connection
await host.logout()
if __name__ == "__main__":
asyncio.run(print_mac_address())
````
Raw data
{
"_id": null,
"home_page": "",
"name": "reolink-ip",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "Reolink,API,camera,NVR,CCTV,Home-Assistant,Home Assistant,Smart Home",
"author": "",
"author_email": "JimStar <bubukis@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/00/fd/c5a0154f023138d8a2f388bf1da1f4241f753c6070057f75290020cc5e27/reolink-ip-0.0.49.tar.gz",
"platform": null,
"description": "<h2 align=\"center\">\n <a href=\"https://reolink.com\"><img src=\"https://raw.githubusercontent.com/JimStar/reolink_ip/master/logo.png\" width=\"200\"></a>\n <br>\n <i>Reolink IP NVR/cameras API package</i>\n <br>\n</h2>\n\n<p align=\"center\">\n <a href=\"https://pypi.org/project/reolink-ip\"><img src=\"https://img.shields.io/pypi/dm/reolink-ip\"></a>\n <img src=\"https://img.shields.io/github/v/release/JimStar/reolink_ip?display_name=tag&include_prereleases&sort=semver\" alt=\"Current version\">\n</p>\n\nThe `reolink_ip` Python package allows you to integrate your [Reolink](https://www.reolink.com/) devices (NVR/cameras) in your application.\n\n### Description\n\nThis is a package implementing Reolink IP NVR and camera API. Also it\u2019s providing a way to subscribe to Reolink ONVIF SWN events, so that real-time events can be received on a webhook.\n\n### Prerequisites\n\n- Python 3.9\n\n### Installation\n\n```\npip3 install reolink-ip\n```\n\nor manually:\n````\ngit clone https://github.com/JimStar/reolink_ip\ncd reolink_ip/\npip3 install .\n````\n\n### Usage\n\n````\n# Create a host-object (representing either a camera, or NVR with several channels)\nhost = api.Host('192.168.1.10', 80, 'user', 'mypassword')\n\n# Obtain/cache NVR or camera settings and capabilities, like model name, ports, HDD size, etc:\nawait host.get_host_data()\n\n# Get the subscribtion port and host-device name:\nsubscribtion_port = host.onvif_port\nname = host.nvr_name\n\n# Obtain/cache states of features:\nawait host.get_states()\n\n# Print some state value on the channel with index 0:\nprint(host.ir_enabled(0))\n\n# Enable the infrared lights on the channel with index 1:\nawait host.set_ir_lights(1, True)\n\n# Enable the spotlight on the channel with index 1:\nawait host.set_spotlight(1, True)\n\n# Enable the siren on the channel with index 0:\nawait host.set_siren(0, True)\n\n# Now subscribe to events, suppose our webhook url is http://192.168.1.11/webhook123\nawait host.subscribe('http://192.168.1.11/webhook123')\n\n# After some minutes check the renew timer (keep the eventing alive):\nif (host.renewTimer <= 100):\n await host.renew()\n\n# Logout and disconnect\nawait host.disconnect()\n````\n\n### Example\n\nThis is an example of the usage of the API. In this case we want to retrive and print the Mac Address of the NVR.\n````\nfrom reolink_ip.api import Host\nimport asyncio\n\nasync def print_mac_address():\n # initialize the host\n host = Host('192.168.1.109', 80, 'admin', 'admin1234')\n # connect and obtain/cache device settings and capabilities\n await host.get_host_data()\n # check if it is a camera or an NVR\n print(\"It is an NVR: %s, number of channels: %s\", host.is_nvr, host.num_channels)\n # print mac address\n print(host.mac_address)\n # close the device connection\n await host.logout()\n\nif __name__ == \"__main__\":\n asyncio.run(print_mac_address())\n````\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2020 JimStar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Reolink IP NVR/camera API",
"version": "0.0.49",
"split_keywords": [
"reolink",
"api",
"camera",
"nvr",
"cctv",
"home-assistant",
"home assistant",
"smart home"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fb47f19250989b6e6664cd70ae82fb6042ab979e4a7917a63a28a1c809858bc0",
"md5": "e0d7422a514b0884203f76b42d5bfd7d",
"sha256": "e0386df1750c82b4fe9682a249ce2d5f7ee64b2fd3dacd50c5feae3b2cd4d6c1"
},
"downloads": -1,
"filename": "reolink_ip-0.0.49-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0d7422a514b0884203f76b42d5bfd7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 27578,
"upload_time": "2023-01-05T08:59:47",
"upload_time_iso_8601": "2023-01-05T08:59:47.110038Z",
"url": "https://files.pythonhosted.org/packages/fb/47/f19250989b6e6664cd70ae82fb6042ab979e4a7917a63a28a1c809858bc0/reolink_ip-0.0.49-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "00fdc5a0154f023138d8a2f388bf1da1f4241f753c6070057f75290020cc5e27",
"md5": "fd9337e3b67614402c38cb286bdeb96b",
"sha256": "92a56b80b2ff1114929fd5796c641b68cf34ea1fd2ccb16bc210d65498cbfeb2"
},
"downloads": -1,
"filename": "reolink-ip-0.0.49.tar.gz",
"has_sig": false,
"md5_digest": "fd9337e3b67614402c38cb286bdeb96b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 28089,
"upload_time": "2023-01-05T08:59:48",
"upload_time_iso_8601": "2023-01-05T08:59:48.379414Z",
"url": "https://files.pythonhosted.org/packages/00/fd/c5a0154f023138d8a2f388bf1da1f4241f753c6070057f75290020cc5e27/reolink-ip-0.0.49.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-05 08:59:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "reolink-ip"
}