Skip to content

Commit 5a62bcb

Browse files
authored
Merge pull request #6 from nirsimetri/dev
Merge all changes on Dev branch to Main for release 0.2.5
2 parents 615c58e + 73ccdc9 commit 5a62bcb

File tree

10 files changed

+312
-55
lines changed

10 files changed

+312
-55
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Thank you for your interest in contributing to the ONVIF Python project! We welc
2626
2. **Create a new branch** for your feature, fix, or documentation update.
2727
3. **Make your changes** with clear, descriptive commit messages.
2828
4. **Test your changes** to ensure they work as expected and do not break existing functionality.
29-
5. **Push your branch** to your fork and open a Pull Request (PR) against the `main` branch of this repository.
29+
5. **Push your branch** to your fork and open a Pull Request (PR) against the `dev` branch of this repository.
3030
6. **Participate in code review** by responding to feedback and making necessary updates.
3131

3232
## Code of Conduct
@@ -45,25 +45,41 @@ All contributors are expected to follow our [Code of Conduct](./CODE_OF_CONDUCT.
4545

4646
## Development Setup
4747

48-
1. **Clone the repository:**
48+
1. **Clone the repository and switch to dev branch:**
4949
```bash
50+
# Option 1: Clone dev branch directly
51+
git clone -b dev https://github.com/nirsimetri/onvif-python.git
52+
cd onvif-python
53+
54+
# Option 2: Clone then switch to dev
5055
git clone https://github.com/nirsimetri/onvif-python.git
5156
cd onvif-python
57+
git checkout dev
5258
```
5359
2. **Install locally:**
5460
```bash
55-
pip install .
61+
# Install the package in development mode
62+
pip install -e .
63+
64+
# Install development dependencies (pytest, black, flake8)
65+
pip install -e ".[dev]"
5666
```
5767
Or use `pyproject.toml` with your preferred tool (e.g., Poetry, pip).
58-
3. (Optional) **Run tests:**
68+
3. **Run tests:**
5969
```bash
6070
pytest
6171
```
62-
4. (Optional) **Lint and format code:**
72+
Make sure all tests pass before submitting your changes.
73+
74+
4. **Lint and format code:**
6375
```bash
76+
# Check code style with flake8
6477
flake8 .
78+
79+
# Format code with black
6580
black .
6681
```
82+
Ensure your code follows PEP8 standards and is properly formatted.
6783
5. **Try example scripts:**
6884
See the [`examples/`](./examples/) folder for usage scenarios.
6985

README.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div align="center">
44
<a href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy"></a>
55
<a href="https://deepwiki.com/nirsimetri/onvif-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg"></a>
6-
<a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.4-orange?logo=archive&color=yellow"></a>
6+
<a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.5-orange?logo=archive&color=yellow"></a>
77
<a href="https://pepy.tech/projects/onvif-python"><img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red"></a>
88
<br>
99
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml"><img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main"></a>
@@ -21,15 +21,21 @@
2121

2222
Behind the scenes, ONVIF communication relies on **[SOAP](https://en.wikipedia.org/wiki/SOAP) (Simple Object Access Protocol)** — an [XML](https://en.wikipedia.org/wiki/XML)-based messaging protocol with strict schema definitions ([WSDL](https://en.wikipedia.org/wiki/Web_Services_Description_Language)/[XSD](https://en.wikipedia.org/wiki/XML_Schema_(W3C))). SOAP ensures interoperability, but when used directly it can be verbose, complex, and error-prone.
2323

24-
This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
24+
This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
2525

26-
## Key Features
27-
- Full implementation of ONVIF core services and profiles
28-
- Support for device discovery, media streaming, PTZ control, event management, and more
29-
- Pythonic abstraction over SOAP requests and responses (no need to handcraft XML)
30-
- Extensible architecture for custom ONVIF extensions
31-
- Compatible with multiple ONVIF specification versions
32-
- Example scripts and tests included
26+
## Library Philosophy
27+
> [!NOTE]
28+
> This library will be continuously updated as ONVIF versions are updated. It uses a built-in WSDL that will always follow changes to the [ONVIF WSDL Specifications](https://github.com/onvif/specs). You can also use your own ONVIF WSDL file by adding the `wsdl_dir` argument; see [ONVIFClient Parameters](#onvifclient-parameters).
29+
30+
- **WYSIWYG (What You See is What You Get)**: Every ONVIF operation in the library mirrors the official ONVIF specification exactly. Method names, parameter structures, and response formats follow ONVIF standards without abstraction layers or renamed interfaces. What you see in the ONVIF documentation is exactly what you get in Python.
31+
32+
- **Device Variety Interoperability**: Built to handle the real-world diversity of ONVIF implementations across manufacturers. The library gracefully handles missing features, optional operations, and vendor-specific behaviors through comprehensive error handling and fallback mechanisms. Whether you're working with high-end enterprise cameras or budget IP cameras, the library adapts.
33+
34+
- **Official Specifications Accuracy**: All service implementations are generated and validated against official `ONVIF WSDL Specifications`. The library includes comprehensive test suites that verify compliance with ONVIF standards, ensuring that method signatures, parameter types, and behavior match the official specifications precisely.
35+
36+
- **Modern Python Approach**: Designed for excellent IDE support with full type hints, auto-completion, and immediate error detection. You'll get `TypeError` exceptions upfront when accessing ONVIF operations with wrong arguments, instead of cryptic `SOAP faults` later. Clean, Pythonic API that feels natural to Python developers while maintaining ONVIF compatibility.
37+
38+
- **Minimal Dependencies**: Only depends on essential, well-maintained libraries (`zeep` for SOAP, `requests` for HTTP). No bloated framework dependencies or custom XML parsers. The library stays lightweight while providing full ONVIF functionality, making it easy to integrate into any project without dependency conflicts.
3339

3440
## Who Is It For?
3541
- **Individual developers** exploring ONVIF or building hobby projects
@@ -308,11 +314,12 @@ This library includes a powerful command-line interface (CLI) for interacting wi
308314
<summary><b>1. Direct CLI</b></summary>
309315

310316
```bash
311-
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE] [--per-page PER_PAGE] [--timeout TIMEOUT] [--https]
312-
[--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--version]
317+
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE]
318+
[--per-page PER_PAGE] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL]
319+
[--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--output OUTPUT] [--version]
313320
[service] [method] [params ...]
314321

315-
ONVIF Terminal Client — v0.2.4
322+
ONVIF Terminal Client — v0.2.5
316323
https://github.com/nirsimetri/onvif-python
317324

318325
positional arguments:
@@ -346,6 +353,9 @@ options:
346353
Caching mode for ONVIFClient (default: all). 'all': memory+disk, 'db': disk-only, 'mem': memory-only, 'none': disabled.
347354
--health-check-interval HEALTH_CHECK_INTERVAL, -hci HEALTH_CHECK_INTERVAL
348355
Health check interval in seconds for interactive mode (default: 10)
356+
--output OUTPUT, -o OUTPUT
357+
Save command output to file. Supports .json, .xml extensions for format detection, or plain text. XML format automatically enables
358+
debug mode for SOAP capture.
349359
--version, -v Show ONVIF CLI version and exit
350360

351361
Examples:
@@ -366,7 +376,12 @@ Examples:
366376

367377
# Direct command execution
368378
onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
369-
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
379+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={'PanTilt': {'x': -0.1, 'y': 0}} -H 192.168.1.17 -P 8000 -u admin -p admin123
380+
381+
# Save output to file
382+
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
383+
onvif media GetProfiles --host 192.168.1.17 --port 8000 --username admin --password admin123 --output profiles.xml
384+
onvif ptz GetConfigurations --host 192.168.1.17 --port 8000 --username admin --password admin123 --output ptz_config.txt --debug
370385

371386
# Interactive mode
372387
onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive
@@ -385,7 +400,7 @@ Examples:
385400
<summary><b>2. Interactive Shell</b></summary>
386401

387402
```bash
388-
ONVIF Interactive Shell — v0.2.4
403+
ONVIF Interactive Shell — v0.2.5
389404
https://github.com/nirsimetri/onvif-python
390405

391406
Basic Commands:
@@ -593,7 +608,11 @@ onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
593608
onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
594609

595610
# Move a PTZ camera
596-
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
611+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1, "y": 0}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
612+
613+
# Save output to file
614+
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
615+
onvif media GetProfiles -H 192.168.1.17 -P 8000 -u admin -p admin123 -o profiles.xml
597616
```
598617

599618
**4. ONVIF Product Search**
@@ -1109,13 +1128,11 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
11091128
- [ ] Add more usage examples for advanced features.
11101129
- [ ] Add benchmarking and performance metrics.
11111130
- [ ] Add community-contributed device configuration templates.
1112-
- [ ] Implement missing or partial ONVIF services.
1113-
- [ ] Add function to expose ONVIF devices (for debugging purposes by the community).
11141131

11151132
## Related Projects
11161133

11171134
- [onvif-products-directory](https://github.com/nirsimetri/onvif-products-directory):
1118-
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide. It provides a unified structure for device, client, and company data, making it easier to perform research, build integrations, and generate statistics for ONVIF ecosystem analysis.
1135+
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide.
11191136

11201137
- (soon) [onvif-rest-server](https://github.com/nirsimetri/onvif-rest-server):
11211138
A RESTful API server for ONVIF devices, enabling easy integration of ONVIF device management, media streaming, and other capabilities into web applications and services.

0 commit comments

Comments
 (0)