Skip to content

Commit 9fdffb7

Browse files
committed
docs(readme): Bump version to v0.1.1
1 parent 4469bf6 commit 9fdffb7

File tree

4 files changed

+148
-14
lines changed

4 files changed

+148
-14
lines changed

README.md

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
44
[![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Wiki-orange)](https://deepwiki.com/nirsimetri/onvif-python)
5-
[![Release](https://img.shields.io/badge/Release-v0.1.0-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
5+
[![Release](https://img.shields.io/badge/Release-v0.1.1-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
66
<br>
7-
[![PyPI](https://img.shields.io/badge/PyPI-0.1.0-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
7+
[![PyPI](https://img.shields.io/badge/PyPI-0.1.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
88
[![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
99

1010
**This project provides a comprehensive and developer-friendly Python library for working with ONVIF-compliant devices.** It is designed to be reliable, easy to integrate, and flexible enough to support a wide range of ONVIF profiles and services.
@@ -120,6 +120,73 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
120120
> [!IMPORTANT]
121121
> If you're new to ONVIF and want to learn more, we highly recommend taking the official free online course provided by ONVIF at [Introduction to ONVIF Course](https://www.onvif.org/about/introduction-to-onvif-course). Please note that we are not endorsed or sponsored by ONVIF, see [Legal Notice](#legal-notice) for details.
122122
123+
## ONVIF CLI
124+
125+
> [!NOTE]
126+
> The CLI is automatically installed when you install the `onvif-python` see [Installation](#installation). This feature has been available since onvif-python version [0.1.0](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.1)
127+
128+
This library includes a powerful command-line interface (CLI) for interacting with ONVIF devices directly from your terminal. It supports both direct command execution and an interactive shell mode, providing a flexible and efficient way to manage and debug ONVIF devices.
129+
130+
### Features
131+
132+
- **Interactive Shell:** A user-friendly shell with tab completion, command history, and colorized output.
133+
- **Direct Command Execution:** Run ONVIF commands directly from the terminal for scripting and automation.
134+
- **Automatic Discovery:** Automatically detects available services on the device.
135+
- **Connection Management:** Supports HTTP/HTTPS, custom timeouts, and SSL verification.
136+
- **Data Management:** Store results from commands and use them as parameters in subsequent commands.
137+
- **Cross-Platform:** Works on Windows, macOS, and Linux.
138+
139+
### Usage
140+
141+
**1. Interactive Mode**
142+
143+
The interactive shell is recommended for exploration and debugging. It provides an intuitive way to navigate services, call methods, and view results.
144+
145+
To start the interactive shell, provide the connection details:
146+
147+
```bash
148+
onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 -i
149+
```
150+
151+
If you omit the username or password, you will be prompted to enter them securely.
152+
153+
**Interactive Shell Commands:**
154+
| Command | Description |
155+
|---|---|
156+
| `help` | Show help information |
157+
| `ls` | List available services or methods in the current context |
158+
| `cd <service>` | Enter a service mode (e.g., `cd devicemgmt`) |
159+
| `up` | Go back to the root context |
160+
| `pwd` | Show the current service context |
161+
| `desc <method>` | Show documentation for a method |
162+
| `store <name>` | Store the last result with a variable name |
163+
| `show <name>` | Display a stored variable |
164+
| `exit` / `quit` | Exit the shell |
165+
166+
You can see all the commands available in the interactive shell by trying them directly.
167+
168+
**2. Direct Command Execution**
169+
170+
You can also execute a single ONVIF command directly. This is useful for scripting or quick checks.
171+
172+
**Syntax:**
173+
```bash
174+
onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
175+
```
176+
177+
**Example:**
178+
```bash
179+
# Get device capabilities
180+
onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
181+
182+
# Move a PTZ camera
183+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
184+
```
185+
186+
### CLI Parameters
187+
188+
All `ONVIFClient` parameters (like `--timeout`, `--https`, `--cache`, etc.) are available as command-line arguments. Use `onvif --help` to see all available options.
189+
123190
## ONVIFClient Parameters
124191

125192
The `ONVIFClient` class provides various configuration options to customize the connection behavior, caching strategy, security settings, and debugging capabilities. Below is a detailed description of all available parameters:
@@ -552,8 +619,8 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
552619
## Future Improvements (Stay tuned and star ⭐ this repo)
553620

554621
- [x] ~~Add debugging mode with raw xml on SOAP requests and responses.~~ ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
555-
- [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f257092e4c9daa23dd0d00825ed38a45d23b70))
556-
- [ ] Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.
622+
- [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f2570))
623+
- [x] ~~Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.~~ ([645be01](https://github.com/nirsimetri/onvif-python/commit/645be01))
557624
- [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
558625
- [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
559626
- [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.

README_ID.md

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![Lisensi](https://img.shields.io/badge/License-MIT-blue)](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
44
[![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Wiki-orange)](https://deepwiki.com/nirsimetri/onvif-python)
5-
[![Rilis](https://img.shields.io/badge/Release-v0.1.0-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
5+
[![Rilis](https://img.shields.io/badge/Release-v0.1.1-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
66
<br>
7-
[![PyPI](https://img.shields.io/badge/PyPI-0.1.0-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
7+
[![PyPI](https://img.shields.io/badge/PyPI-0.1.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
88
[![Unduhan](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
99

1010
**Proyek ini menyediakan pustaka Python yang komprehensif dan ramah pengembang untuk bekerja dengan perangkat yang sesuai dengan ONVIF.** Pustaka ini dirancang agar andal, mudah diintegrasikan, dan cukup fleksibel untuk mendukung berbagai profil dan layanan ONVIF.
@@ -120,6 +120,73 @@ Jelajahi penggunaan lanjutan dan operasi spesifik layanan di folder [`examples/`
120120
> [!IMPORTANT]
121121
> Jika Anda baru mengenal ONVIF dan ingin mempelajari lebih lanjut, kami sangat menyarankan untuk mengikuti kursus online gratis resmi yang disediakan oleh ONVIF di [Kursus Pengantar ONVIF](https://www.onvif.org/about/introduction-to-onvif-course). Harap dicatat bahwa kami tidak didukung atau disponsori oleh ONVIF, lihat [Pemberitahuan Hukum](#legal-notice) untuk detailnya.
122122
123+
## ONVIF CLI
124+
125+
> [!NOTE]
126+
> CLI secara otomatis terinstal saat Anda menginstal paket `onvif-python`, lihat [Instalasi](#instalasi). Fitur ini telah tersedia sejak onvif-python versi [0.1.0](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.1)
127+
128+
Pustaka ini menyertakan antarmuka baris perintah (CLI) yang kuat untuk berinteraksi dengan perangkat ONVIF langsung dari terminal Anda. CLI ini mendukung eksekusi perintah langsung dan mode shell interaktif, menyediakan cara yang fleksibel dan efisien untuk mengelola dan men-debug perangkat ONVIF.
129+
130+
### Fitur
131+
132+
- **Shell Interaktif:** Shell yang ramah pengguna dengan pelengkapan tab, riwayat perintah, dan output berwarna.
133+
- **Eksekusi Perintah Langsung:** Jalankan perintah ONVIF langsung dari terminal untuk skrip dan otomatisasi.
134+
- **Penemuan Otomatis:** Secara otomatis mendeteksi layanan yang tersedia di perangkat.
135+
- **Manajemen Koneksi:** Mendukung HTTP/HTTPS, timeout kustom, dan verifikasi SSL.
136+
- **Manajemen Data:** Simpan hasil dari perintah dan gunakan sebagai parameter dalam perintah berikutnya.
137+
- **Lintas Platform:** Bekerja di Windows, macOS, dan Linux.
138+
139+
### Penggunaan
140+
141+
**1. Mode Interaktif**
142+
143+
Shell interaktif direkomendasikan untuk eksplorasi dan debugging. Ini menyediakan cara intuitif untuk menavigasi layanan, memanggil metode, dan melihat hasil.
144+
145+
Untuk memulai shell interaktif, berikan detail koneksi:
146+
147+
```bash
148+
onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 -i
149+
```
150+
151+
Jika Anda tidak menyertakan nama pengguna atau kata sandi, Anda akan diminta untuk memasukkannya secara aman.
152+
153+
**Perintah Shell Interaktif:**
154+
| Perintah | Deskripsi |
155+
|---|---|
156+
| `help` | Tampilkan informasi bantuan |
157+
| `ls` | Daftar layanan atau metode yang tersedia dalam konteks saat ini |
158+
| `cd <service>` | Masuk ke mode layanan (mis., `cd devicemgmt`) |
159+
| `up` | Kembali ke konteks root |
160+
| `pwd` | Tampilkan konteks layanan saat ini |
161+
| `desc <method>` | Tampilkan dokumentasi untuk sebuah metode |
162+
| `store <name>` | Simpan hasil terakhir dengan nama variabel |
163+
| `show <name>` | Tampilkan variabel yang disimpan |
164+
| `exit` / `quit` | Keluar dari shell |
165+
166+
Anda dapat melihat semua perintah yang tersedia di shell interaktif dengan mencobanya langsung.
167+
168+
**2. Eksekusi Perintah Langsung**
169+
170+
Anda juga dapat mengeksekusi satu perintah ONVIF secara langsung. Ini berguna untuk skrip atau pengecekan cepat.
171+
172+
**Sintaks:**
173+
```bash
174+
onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
175+
```
176+
177+
**Contoh:**
178+
```bash
179+
# Dapatkan kapabilitas perangkat
180+
onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
181+
182+
# Gerakkan kamera PTZ
183+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
184+
```
185+
186+
### Parameter CLI
187+
188+
Semua parameter `ONVIFClient` (seperti `--timeout`, `--https`, `--cache`, dll.) tersedia sebagai argumen baris perintah. Gunakan `onvif --help` untuk melihat semua opsi yang tersedia.
189+
123190
## Parameter ONVIFClient
124191

125192
Kelas `ONVIFClient` menyediakan berbagai opsi konfigurasi untuk menyesuaikan perilaku koneksi, strategi caching, pengaturan keamanan, dan kemampuan debugging. Berikut adalah deskripsi detail dari semua parameter yang tersedia:
@@ -551,8 +618,8 @@ Beberapa layanan ONVIF memiliki banyak binding dalam WSDL yang sama. Biasanya me
551618
## Peningkatan Mendatang (Pantau dan beri bintang ⭐ repo ini)
552619

553620
- [x] ~~Menambahkan mode debugging dengan raw XML pada permintaan dan respons SOAP.~~ ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
554-
- [x] ~~Menambahkan fungsionalitas agar `ONVIFClient` dapat menerima layanan `wsdl_dir` kustom.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f257092e4c9daa23dd0d00825ed38a45d23b70))
555-
- [ ] Menambahkan program `ONVIF CLI` untuk berinteraksi langsung dengan perangkat ONVIF melalui terminal.
621+
- [x] ~~Menambahkan fungsionalitas agar `ONVIFClient` dapat menerima layanan `wsdl_dir` kustom.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f2570))
622+
- [x] ~~Menambahkan program `ONVIF CLI` untuk berinteraksi langsung dengan perangkat ONVIF melalui terminal.~~ ([645be01](https://github.com/nirsimetri/onvif-python/commit/645be01))
556623
- [ ] Menambahkan dukungan asynchronous (async/await) untuk operasi ONVIF non-blocking dan komunikasi perangkat secara bersamaan.
557624
- [ ] Mengimplementasikan model data terstruktur untuk Skema ONVIF menggunakan [xsdata](https://github.com/tefra/xsdata).
558625
- [ ] Mengintegrasikan [xmltodict](https://github.com/martinblech/xmltodict) untuk parsing dan konversi XML yang lebih sederhana.

onvif/cli/interactive.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

onvif/cli/main.py

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)