edgelens-sdk 0.2.1__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.
- edgelens_sdk-0.2.1/.gitignore +92 -0
- edgelens_sdk-0.2.1/LICENSE +21 -0
- edgelens_sdk-0.2.1/PKG-INFO +109 -0
- edgelens_sdk-0.2.1/README.md +80 -0
- edgelens_sdk-0.2.1/edgelens/__init__.py +61 -0
- edgelens_sdk-0.2.1/edgelens/_http.py +543 -0
- edgelens_sdk-0.2.1/edgelens/_version.py +1 -0
- edgelens_sdk-0.2.1/edgelens/aio.py +392 -0
- edgelens_sdk-0.2.1/edgelens/client.py +113 -0
- edgelens_sdk-0.2.1/edgelens/device.py +384 -0
- edgelens_sdk-0.2.1/edgelens/errors.py +23 -0
- edgelens_sdk-0.2.1/edgelens/session.py +286 -0
- edgelens_sdk-0.2.1/edgelens/types.py +122 -0
- edgelens_sdk-0.2.1/pyproject.toml +59 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
.pytest_cache/
|
|
24
|
+
.tox/
|
|
25
|
+
.coverage
|
|
26
|
+
.coverage.*
|
|
27
|
+
htmlcov/
|
|
28
|
+
.hypothesis/
|
|
29
|
+
.mypy_cache/
|
|
30
|
+
.ruff_cache/
|
|
31
|
+
|
|
32
|
+
# Virtual environments
|
|
33
|
+
venv/
|
|
34
|
+
.venv/
|
|
35
|
+
env/
|
|
36
|
+
ENV/
|
|
37
|
+
|
|
38
|
+
# Node / TypeScript
|
|
39
|
+
node_modules/
|
|
40
|
+
*.log
|
|
41
|
+
npm-debug.log*
|
|
42
|
+
yarn-debug.log*
|
|
43
|
+
yarn-error.log*
|
|
44
|
+
.npm
|
|
45
|
+
.eslintcache
|
|
46
|
+
.parcel-cache
|
|
47
|
+
.next
|
|
48
|
+
out/
|
|
49
|
+
.cache/
|
|
50
|
+
*.tsbuildinfo
|
|
51
|
+
|
|
52
|
+
# Go
|
|
53
|
+
*.exe
|
|
54
|
+
*.exe~
|
|
55
|
+
*.dll
|
|
56
|
+
*.dylib
|
|
57
|
+
*.test
|
|
58
|
+
*.out
|
|
59
|
+
go.work
|
|
60
|
+
vendor/
|
|
61
|
+
# `*.test` above is Go's compiled per-package test binary (go test -c). The
|
|
62
|
+
# container test images are named Dockerfile.test / Dockerfile.test-typescript,
|
|
63
|
+
# so negate those back in.
|
|
64
|
+
!Dockerfile.test
|
|
65
|
+
!Dockerfile.test-*
|
|
66
|
+
|
|
67
|
+
# k6 — built xk6 binary lives at repo root after `xk6 build`. The
|
|
68
|
+
# anchored slashes scope the ignore so examples/k6/ + integrations/k6/
|
|
69
|
+
# aren't swallowed.
|
|
70
|
+
/xk6
|
|
71
|
+
/k6
|
|
72
|
+
|
|
73
|
+
# IDE
|
|
74
|
+
.vscode/
|
|
75
|
+
.idea/
|
|
76
|
+
*.swp
|
|
77
|
+
*.swo
|
|
78
|
+
*~
|
|
79
|
+
|
|
80
|
+
# OS
|
|
81
|
+
.DS_Store
|
|
82
|
+
Thumbs.db
|
|
83
|
+
|
|
84
|
+
# Secrets
|
|
85
|
+
.env
|
|
86
|
+
.env.local
|
|
87
|
+
*.pem
|
|
88
|
+
*.key
|
|
89
|
+
|
|
90
|
+
# Demo run output. These are photographs taken by a device in a rack, so
|
|
91
|
+
# they show whatever the sensor was pointed at — never commit them here.
|
|
92
|
+
examples/*/artifacts/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 EdgeLens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: edgelens-sdk
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Python client for the EdgeLens Edge AI Device Farm
|
|
5
|
+
Project-URL: Homepage, https://edgelens.ai
|
|
6
|
+
Project-URL: Repository, https://github.com/edgelens-ai/edgelens-sdk
|
|
7
|
+
Project-URL: Issues, https://github.com/edgelens-ai/edgelens-sdk/issues
|
|
8
|
+
Project-URL: Documentation, https://docs.edgelens.ai
|
|
9
|
+
Author-email: EdgeLens <support@edgelens.ai>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Testing
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Requires-Dist: httpx>=0.27
|
|
22
|
+
Requires-Dist: pydantic>=2.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.1; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# edgelens-sdk — Python client for the EdgeLens Edge AI Device Farm
|
|
31
|
+
|
|
32
|
+
The base Python client used by all Python EdgeLens integrations (pytest, Robot Framework, MLflow, W&B, the CLI, and the MCP server).
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install edgelens-sdk
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The distribution is `edgelens-sdk`; the import name is `edgelens`
|
|
41
|
+
(`from edgelens import EdgeLensClient`). The PyPI package named
|
|
42
|
+
`edgelens` is an unrelated project and is not this SDK.
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from edgelens import EdgeLensClient
|
|
48
|
+
|
|
49
|
+
client = EdgeLensClient() # reads EDGELENS_API_KEY from env
|
|
50
|
+
|
|
51
|
+
with client.create_session(device_type="recamera-2002", os="stock-os") as session:
|
|
52
|
+
session.wait_ready()
|
|
53
|
+
|
|
54
|
+
session.device.deploy(model="./models/face_detection.cvimodel")
|
|
55
|
+
session.device.display.play("./test_data/crowd_scene.mp4")
|
|
56
|
+
|
|
57
|
+
stats = session.device.inference.run(duration=30)
|
|
58
|
+
assert stats.fps.avg > 15
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For reCamaginedOS (raw, customer provides binary):
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
with client.create_session(device_type="recamera-2002", os="recamagined") as session:
|
|
65
|
+
session.wait_ready()
|
|
66
|
+
|
|
67
|
+
# Files land in /userdata/Models/ on reCamaginedOS.
|
|
68
|
+
session.device.deploy(
|
|
69
|
+
model="./build/my_inference",
|
|
70
|
+
files=["./models/my_model.cvimodel"],
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
result = session.device.exec(
|
|
74
|
+
"chmod +x /userdata/Models/my_inference && "
|
|
75
|
+
"/userdata/Models/my_inference "
|
|
76
|
+
"--model /userdata/Models/my_model.cvimodel --duration 10"
|
|
77
|
+
)
|
|
78
|
+
assert result.success
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
On reCamaginedOS, `deploy(model=..., files=[...])` places the model and
|
|
82
|
+
each file in `/userdata/Models/` under its base filename. Files arrive
|
|
83
|
+
readable but not executable: before running a deployed binary, make it
|
|
84
|
+
executable, e.g. `chmod +x /userdata/Models/my_inference`.
|
|
85
|
+
|
|
86
|
+
## API Surface
|
|
87
|
+
|
|
88
|
+
- `EdgeLensClient` — entry point, creates sessions
|
|
89
|
+
- `Session` — session lifecycle (wait_ready, refresh, release)
|
|
90
|
+
- `Device` — device operations
|
|
91
|
+
- `device.deploy()` — model deployment
|
|
92
|
+
- `device.display.*` — display control (play, show, stop)
|
|
93
|
+
- `device.inference.*` — built-in inference (stock OS only)
|
|
94
|
+
- `device.exec()` — run commands via SSH
|
|
95
|
+
- `device.ssh()` — SSH connection details
|
|
96
|
+
- `device.info()` — device info report
|
|
97
|
+
- `device.stream_url()` — camera stream URL (stock OS only)
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd core/python
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pytest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# edgelens-sdk — Python client for the EdgeLens Edge AI Device Farm
|
|
2
|
+
|
|
3
|
+
The base Python client used by all Python EdgeLens integrations (pytest, Robot Framework, MLflow, W&B, the CLI, and the MCP server).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install edgelens-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The distribution is `edgelens-sdk`; the import name is `edgelens`
|
|
12
|
+
(`from edgelens import EdgeLensClient`). The PyPI package named
|
|
13
|
+
`edgelens` is an unrelated project and is not this SDK.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from edgelens import EdgeLensClient
|
|
19
|
+
|
|
20
|
+
client = EdgeLensClient() # reads EDGELENS_API_KEY from env
|
|
21
|
+
|
|
22
|
+
with client.create_session(device_type="recamera-2002", os="stock-os") as session:
|
|
23
|
+
session.wait_ready()
|
|
24
|
+
|
|
25
|
+
session.device.deploy(model="./models/face_detection.cvimodel")
|
|
26
|
+
session.device.display.play("./test_data/crowd_scene.mp4")
|
|
27
|
+
|
|
28
|
+
stats = session.device.inference.run(duration=30)
|
|
29
|
+
assert stats.fps.avg > 15
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For reCamaginedOS (raw, customer provides binary):
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
with client.create_session(device_type="recamera-2002", os="recamagined") as session:
|
|
36
|
+
session.wait_ready()
|
|
37
|
+
|
|
38
|
+
# Files land in /userdata/Models/ on reCamaginedOS.
|
|
39
|
+
session.device.deploy(
|
|
40
|
+
model="./build/my_inference",
|
|
41
|
+
files=["./models/my_model.cvimodel"],
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
result = session.device.exec(
|
|
45
|
+
"chmod +x /userdata/Models/my_inference && "
|
|
46
|
+
"/userdata/Models/my_inference "
|
|
47
|
+
"--model /userdata/Models/my_model.cvimodel --duration 10"
|
|
48
|
+
)
|
|
49
|
+
assert result.success
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
On reCamaginedOS, `deploy(model=..., files=[...])` places the model and
|
|
53
|
+
each file in `/userdata/Models/` under its base filename. Files arrive
|
|
54
|
+
readable but not executable: before running a deployed binary, make it
|
|
55
|
+
executable, e.g. `chmod +x /userdata/Models/my_inference`.
|
|
56
|
+
|
|
57
|
+
## API Surface
|
|
58
|
+
|
|
59
|
+
- `EdgeLensClient` — entry point, creates sessions
|
|
60
|
+
- `Session` — session lifecycle (wait_ready, refresh, release)
|
|
61
|
+
- `Device` — device operations
|
|
62
|
+
- `device.deploy()` — model deployment
|
|
63
|
+
- `device.display.*` — display control (play, show, stop)
|
|
64
|
+
- `device.inference.*` — built-in inference (stock OS only)
|
|
65
|
+
- `device.exec()` — run commands via SSH
|
|
66
|
+
- `device.ssh()` — SSH connection details
|
|
67
|
+
- `device.info()` — device info report
|
|
68
|
+
- `device.stream_url()` — camera stream URL (stock OS only)
|
|
69
|
+
|
|
70
|
+
## Development
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
cd core/python
|
|
74
|
+
pip install -e ".[dev]"
|
|
75
|
+
pytest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""EdgeLens Python client.
|
|
2
|
+
|
|
3
|
+
Test edge AI models on real hardware from your Python code.
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
from edgelens import EdgeLensClient
|
|
7
|
+
|
|
8
|
+
client = EdgeLensClient(api_key="...")
|
|
9
|
+
session = client.create_session(device_type="recamera-2002", os="stock-os")
|
|
10
|
+
session.wait_ready()
|
|
11
|
+
|
|
12
|
+
session.device.deploy(model="./models/face_detection.cvimodel")
|
|
13
|
+
session.device.display.play("./test_data/crowd_scene.mp4")
|
|
14
|
+
stats = session.device.inference.run(duration=30)
|
|
15
|
+
|
|
16
|
+
assert stats.fps.avg > 15
|
|
17
|
+
session.release()
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from edgelens._version import __version__ as __version__
|
|
21
|
+
from edgelens._http import RetryPolicy
|
|
22
|
+
from edgelens.client import EdgeLensClient
|
|
23
|
+
from edgelens.errors import (
|
|
24
|
+
EdgeLensError,
|
|
25
|
+
AuthenticationError,
|
|
26
|
+
SessionError,
|
|
27
|
+
DeviceError,
|
|
28
|
+
TimeoutError,
|
|
29
|
+
)
|
|
30
|
+
from edgelens.session import Session
|
|
31
|
+
from edgelens.device import Device
|
|
32
|
+
from edgelens.types import (
|
|
33
|
+
DeviceType,
|
|
34
|
+
OSType,
|
|
35
|
+
SessionStatus,
|
|
36
|
+
InferenceStats,
|
|
37
|
+
Detection,
|
|
38
|
+
DeviceInfo,
|
|
39
|
+
BBox,
|
|
40
|
+
PercentileStats,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"EdgeLensClient",
|
|
45
|
+
"Session",
|
|
46
|
+
"Device",
|
|
47
|
+
"DeviceType",
|
|
48
|
+
"OSType",
|
|
49
|
+
"SessionStatus",
|
|
50
|
+
"InferenceStats",
|
|
51
|
+
"Detection",
|
|
52
|
+
"DeviceInfo",
|
|
53
|
+
"BBox",
|
|
54
|
+
"PercentileStats",
|
|
55
|
+
"RetryPolicy",
|
|
56
|
+
"EdgeLensError",
|
|
57
|
+
"AuthenticationError",
|
|
58
|
+
"SessionError",
|
|
59
|
+
"DeviceError",
|
|
60
|
+
"TimeoutError",
|
|
61
|
+
]
|