pyimouapi 1.2.6__tar.gz → 1.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyimouapi
3
+ Version: 1.2.8
4
+ Summary: A package for imou open api
5
+ Home-page: https://github.com/Imou-OpenPlatform/Py-Imou-Open-Api
6
+ Author: Imou-OpenPlatform
7
+ Author-email: Imou-OpenPlatform <cloud_openteam_service@imou.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/Imou-OpenPlatform/Py-Imou-Open-Api
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: aiohttp<4.0,>=3.11.9
14
+ Requires-Dist: simpleeval>=1.0.3
15
+ Dynamic: author
16
+ Dynamic: home-page
17
+ Dynamic: license-file
18
+ Dynamic: requires-python
19
+
20
+ # pyimouapi
21
+
22
+ Async Python client for the **Imou Open Platform** cloud APIs. Built on **aiohttp**, it handles authentication and requests, and exposes device/channel helpers plus higher-level types for integrations (for example Home Assistant).
23
+
24
+ - **Repository:** [Imou-OpenPlatform/Py-Imou-Open-Api](https://github.com/Imou-OpenPlatform/Py-Imou-Open-Api)
25
+ - **Version:** Same as `setup.py` / PyPI (`pyimouapi.__version__`)
26
+ - **Python:** `>= 3.11`
27
+
28
+ ## Package layout
29
+
30
+ | Module | Role |
31
+ |--------|------|
32
+ | `pyimouapi.openapi` | `ImouOpenApiClient` — auth, signing, token lifecycle, HTTP calls |
33
+ | `pyimouapi.device` | `ImouDeviceManager`, `ImouDevice`, `ImouChannel` — listing, PTZ, alarms, storage, and related endpoints |
34
+ | `pyimouapi.ha_device` | `ImouHaDeviceManager`, `ImouHaDevice`, … — aggregated “device model” helpers for automation stacks |
35
+ | `pyimouapi.exceptions` | `ImouException` and typed errors (connect, request, invalid credentials, …) |
36
+
37
+ The top-level `pyimouapi` package re-exports common symbols. Import submodules directly when needed, for example `from pyimouapi.ha_device import ImouHaDeviceManager`.
38
+
39
+ ## Dependencies
40
+
41
+ As declared in `setup.py` / `requirements.txt`:
42
+
43
+ - `aiohttp>=3.11.9,<4.0`
44
+ - `simpleeval>=1.0.3`
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ pip install pyimouapi
50
+ ```
51
+
52
+ From a checkout:
53
+
54
+ ```bash
55
+ pip install .
56
+ ```
57
+
58
+ ## Quick example (async)
59
+
60
+ ```python
61
+ from pyimouapi.openapi import ImouOpenApiClient
62
+
63
+ # host: Imou Open Platform gateway, e.g. openapi-sg.easy4ip.com
64
+ client = ImouOpenApiClient("your_app_id", "your_app_secret", "openapi-sg.easy4ip.com")
65
+ await client.async_get_token()
66
+ # Use the client with pyimouapi.device.ImouDeviceManager for device operations
67
+ ```
68
+
69
+ ## License
70
+
71
+ MIT — see `LICENSE` in this repository.
@@ -0,0 +1,52 @@
1
+ # pyimouapi
2
+
3
+ Async Python client for the **Imou Open Platform** cloud APIs. Built on **aiohttp**, it handles authentication and requests, and exposes device/channel helpers plus higher-level types for integrations (for example Home Assistant).
4
+
5
+ - **Repository:** [Imou-OpenPlatform/Py-Imou-Open-Api](https://github.com/Imou-OpenPlatform/Py-Imou-Open-Api)
6
+ - **Version:** Same as `setup.py` / PyPI (`pyimouapi.__version__`)
7
+ - **Python:** `>= 3.11`
8
+
9
+ ## Package layout
10
+
11
+ | Module | Role |
12
+ |--------|------|
13
+ | `pyimouapi.openapi` | `ImouOpenApiClient` — auth, signing, token lifecycle, HTTP calls |
14
+ | `pyimouapi.device` | `ImouDeviceManager`, `ImouDevice`, `ImouChannel` — listing, PTZ, alarms, storage, and related endpoints |
15
+ | `pyimouapi.ha_device` | `ImouHaDeviceManager`, `ImouHaDevice`, … — aggregated “device model” helpers for automation stacks |
16
+ | `pyimouapi.exceptions` | `ImouException` and typed errors (connect, request, invalid credentials, …) |
17
+
18
+ The top-level `pyimouapi` package re-exports common symbols. Import submodules directly when needed, for example `from pyimouapi.ha_device import ImouHaDeviceManager`.
19
+
20
+ ## Dependencies
21
+
22
+ As declared in `setup.py` / `requirements.txt`:
23
+
24
+ - `aiohttp>=3.11.9,<4.0`
25
+ - `simpleeval>=1.0.3`
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ pip install pyimouapi
31
+ ```
32
+
33
+ From a checkout:
34
+
35
+ ```bash
36
+ pip install .
37
+ ```
38
+
39
+ ## Quick example (async)
40
+
41
+ ```python
42
+ from pyimouapi.openapi import ImouOpenApiClient
43
+
44
+ # host: Imou Open Platform gateway, e.g. openapi-sg.easy4ip.com
45
+ client = ImouOpenApiClient("your_app_id", "your_app_secret", "openapi-sg.easy4ip.com")
46
+ await client.async_get_token()
47
+ # Use the client with pyimouapi.device.ImouDeviceManager for device operations
48
+ ```
49
+
50
+ ## License
51
+
52
+ MIT — see `LICENSE` in this repository.
@@ -0,0 +1,20 @@
1
+ __version__ = "1.2.8"
2
+
3
+ from .device import ImouChannel, ImouDevice, ImouDeviceManager
4
+ from .exceptions import (
5
+ ConnectFailedException,
6
+ InvalidAppIdOrSecretException,
7
+ RequestFailedException,
8
+ )
9
+ from .openapi import ImouOpenApiClient
10
+
11
+ __all__ = [
12
+ "ConnectFailedException",
13
+ "ImouChannel",
14
+ "ImouDevice",
15
+ "ImouDeviceManager",
16
+ "ImouOpenApiClient",
17
+ "InvalidAppIdOrSecretException",
18
+ "RequestFailedException",
19
+ "__version__",
20
+ ]
@@ -518,5 +518,5 @@ NIGHT_VISION_MODE_MAP = {
518
518
  "infrared": "Infrared",
519
519
  "off": "Off",
520
520
  "lowlight": "LowLight",
521
- "smartlowlight": "SmartLowLight"
521
+ "smartlowlight": "SmartLowLight",
522
522
  }
@@ -3,63 +3,63 @@ from __future__ import annotations
3
3
  from typing import Any
4
4
 
5
5
  from .const import (
6
- API_ENDPOINT_LIST_DEVICE_DETAILS,
7
- PARAM_PAGE_SIZE,
8
- PARAM_PAGE,
9
- PARAM_DEVICE_ID,
10
- PARAM_CHANNEL_ID,
6
+ API_ENDPOINT_BIND_DEVICE_LIVE,
11
7
  API_ENDPOINT_CONTROL_DEVICE_PTZ,
12
- API_ENDPOINT_MODIFY_DEVICE_ALARM_STATUS,
13
- API_ENDPOINT_GET_DEVICE_STATUS,
14
- API_ENDPOINT_SET_DEVICE_STATUS,
15
- API_ENDPOINT_GET_DEVICE_NIGHT_VISION_MODE,
8
+ API_ENDPOINT_DEVICE_SD_CARD_STATUS,
16
9
  API_ENDPOINT_DEVICE_STORAGE,
17
- API_ENDPOINT_RESTART_DEVICE,
18
- API_ENDPOINT_BIND_DEVICE_LIVE,
19
- API_ENDPOINT_GET_DEVICE_ONLINE,
10
+ API_ENDPOINT_GET_DEVICE_ALARM_PARAM,
20
11
  API_ENDPOINT_GET_DEVICE_LIVE_INFO,
12
+ API_ENDPOINT_GET_DEVICE_NIGHT_VISION_MODE,
13
+ API_ENDPOINT_GET_DEVICE_ONLINE,
14
+ API_ENDPOINT_GET_DEVICE_POWER_INFO,
15
+ API_ENDPOINT_GET_DEVICE_STATUS,
16
+ API_ENDPOINT_GET_IOT_DEVICE_DETAIL_INFO,
17
+ API_ENDPOINT_GET_IOT_DEVICE_PROPERTIES,
18
+ API_ENDPOINT_GET_PRODUCT_MODEL,
19
+ API_ENDPOINT_IOT_DEVICE_CONTROL,
20
+ API_ENDPOINT_LIST_DEVICE_DETAILS,
21
+ API_ENDPOINT_MODIFY_DEVICE_ALARM_STATUS,
22
+ API_ENDPOINT_RESTART_DEVICE,
23
+ API_ENDPOINT_SET_DEVICE_NIGHT_VISION_MODE,
21
24
  API_ENDPOINT_SET_DEVICE_SNAP,
22
- PARAM_MODE,
23
- PARAM_ENABLE_TYPE,
24
- PARAM_ENABLE,
25
+ API_ENDPOINT_SET_DEVICE_STATUS,
26
+ API_ENDPOINT_SET_IOT_DEVICE_PROPERTIES,
27
+ API_ENDPOINT_WAKE_UP_DEVICE,
28
+ NIGHT_VISION_MODE_MAP,
29
+ PARAM_ABILITY_REFS,
30
+ PARAM_ACCESS_TYPE,
31
+ PARAM_BRAND,
32
+ PARAM_CHANNEL_ABILITY,
33
+ PARAM_CHANNEL_ID,
34
+ PARAM_CHANNEL_LIST,
35
+ PARAM_CHANNEL_NAME,
36
+ PARAM_CHANNEL_NUM,
37
+ PARAM_CHANNEL_STATUS,
38
+ PARAM_CHANNELS,
39
+ PARAM_CONTENT,
25
40
  PARAM_COUNT,
41
+ PARAM_DEVICE_ABILITY,
42
+ PARAM_DEVICE_ID,
26
43
  PARAM_DEVICE_LIST,
44
+ PARAM_DEVICE_MODEL,
27
45
  PARAM_DEVICE_NAME,
28
46
  PARAM_DEVICE_STATUS,
29
- PARAM_DEVICE_ABILITY,
30
47
  PARAM_DEVICE_VERSION,
31
- PARAM_BRAND,
32
- PARAM_DEVICE_MODEL,
33
- PARAM_CHANNEL_LIST,
34
- PARAM_CHANNEL_NAME,
35
- PARAM_CHANNEL_STATUS,
36
- PARAM_CHANNEL_ABILITY,
37
- PARAM_STREAM_ID,
38
- PARAM_OPERATION,
39
48
  PARAM_DURATION,
40
- API_ENDPOINT_GET_DEVICE_ALARM_PARAM,
41
- API_ENDPOINT_SET_DEVICE_NIGHT_VISION_MODE,
49
+ PARAM_ENABLE,
50
+ PARAM_ENABLE_TYPE,
51
+ PARAM_MODE,
52
+ PARAM_MULTI_FLAG,
53
+ PARAM_OPERATION,
54
+ PARAM_PAGE,
55
+ PARAM_PAGE_SIZE,
56
+ PARAM_PARENT_DEVICE_ID,
57
+ PARAM_PARENT_PRODUCT_ID,
42
58
  PARAM_PRODUCT_ID,
43
59
  PARAM_PROPERTIES,
44
- API_ENDPOINT_GET_IOT_DEVICE_PROPERTIES,
45
- API_ENDPOINT_SET_IOT_DEVICE_PROPERTIES,
46
- API_ENDPOINT_DEVICE_SD_CARD_STATUS,
47
- PARAM_CHANNEL_NUM,
48
- PARAM_PARENT_PRODUCT_ID,
49
- PARAM_PARENT_DEVICE_ID,
50
60
  PARAM_REF,
51
- PARAM_CONTENT,
52
- API_ENDPOINT_IOT_DEVICE_CONTROL,
53
- PARAM_MULTI_FLAG,
54
- API_ENDPOINT_GET_DEVICE_POWER_INFO,
55
- API_ENDPOINT_GET_PRODUCT_MODEL,
56
- API_ENDPOINT_GET_IOT_DEVICE_DETAIL_INFO,
57
- PARAM_ABILITY_REFS,
58
- PARAM_CHANNELS,
59
- PARAM_ACCESS_TYPE,
60
- API_ENDPOINT_WAKE_UP_DEVICE,
61
+ PARAM_STREAM_ID,
61
62
  PARAM_URL,
62
- NIGHT_VISION_MODE_MAP,
63
63
  )
64
64
  from .openapi import ImouOpenApiClient
65
65