Hikrobot SDK – Python Wrapper
A lightweight, Pythonic wrapper around the Hikrobot (Hikvision Industrial) MVS Camera SDK, simplifying device enumeration, camera detection, frame grabbing, and pixel format conversion.
This package includes a wrapper for the official MvCameraControl SDK through the MvImport Python bindings.
⭐ Features
- Thread-safe device enumeration
- Device list caching for performance
- Find camera by serial number
- Simple
CameraDevicelifecycle - Raw frame grabbing (
MV_CC_GetOneFrameTimeout) - Convert frames to RGB
- Supports GigE & USB3 Hikrobot cameras
- Set camera parameters (int, float, bool, enum, command)
📦 Installation
Note: The official Hikrobot MVS SDK must be installed separately.
Install via pip:
pip install hikrobot-sdk
Ensure the Hikrobot SDK is installed:
- Linux:
/opt/MVS/ - Windows:
C:\Program Files\MVS\Development\
📁 Package Structure
hikrobot/
│
├── hikrobot_sdk.py
└── MvImport/
├── MvCameraControl_class.py
└── (other Hikrobot SDK Python files)
🚀 Quick Start
🔍 Enumerate Devices
from hikrobot import DeviceManager
devices = DeviceManager.enumerate()
print("Devices found:", devices.nDeviceNum)
🎯 Find a Camera by Serial Number
from hikrobot import DeviceManager
device_info = DeviceManager.find_camera("YOUR_CAMERA_SN")
if device_info:
print("Camera found")
else:
print("Camera not found")
📷 Open Camera and Grab a Frame
from hikrobot import CameraDevice, DeviceManager
device_info = DeviceManager.find_camera("YOUR_CAMERA_SN")
cam = CameraDevice(device_info)
if cam.create_handle_and_open():
cam.start_grabbing()
frame = cam.get_one_frame(1000)
if frame:
raw_bytes, info = frame
print("Frame:", info.nWidth, "x", info.nHeight)
cam.stop_grabbing()
cam.close_and_destroy()
🎨 Convert Raw Frame to RGB
raw_bytes, info = cam.get_one_frame()
rgb_bytes = cam.convert_to_rgb(raw_bytes, info)
🔧 Set Camera Parameters
cam.set_value("ExposureTime", 12000)
cam.set_value("Gain", 5)
cam.set_value("TriggerMode", 1)
🧠 Class Overview
DeviceManager
- Thread-safe device scanning
- Caches device list
- Extracts serial numbers for GigE & USB cameras
Methods:
enumerate()find_camera(serial_number)refresh()
CameraDevice
- High-level wrapper around
MvCamerainstance
Methods:
create_handle_and_open()start_grabbing()stop_grabbing()get_one_frame(timeout_ms)convert_to_rgb(raw_bytes, frame_info)close_and_destroy()set_value(name, value)_register_exception_callback()
📄 License
MIT License.
Metadata
Release files for hikrobot-sdk 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hikrobot_sdk-0.1.1.tar.gz | 68.7 kB | Without provenance | Details for hikrobot_sdk-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hikrobot_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for hikrobot_sdk-0.1.1-py3-none-any.whl |
Total release size: 139.4 kB
Release files / hikrobot_sdk-0.1.1.tar.gz
| Download URL | hikrobot_sdk-0.1.1.tar.gz |
|---|---|
| Size | 68.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7acb26d6c66cadd08b743517b8c478b23ae0732cea870d84c81779172c527a56
|
|
BLAKE2b-256 checksum How to use checksums |
d653bf2fd337621f463f3c0c9703d2c6afb49c9ec03636872b9564d073d0b47e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|
Release files / hikrobot_sdk-0.1.1-py3-none-any.whl
| Download URL | hikrobot_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 70.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc67568d21289f8a929be789ce5ce036565a43acadadeca53178f9f168ddd789
|
|
BLAKE2b-256 checksum How to use checksums |
ca709dced0954f49b2ae6276bdf8314d3bfbe14dbf81363971270feed3f3267f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|
Security for hikrobot-sdk 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.