Skip to content

Commit 92fb83f

Browse files
committed
docs(readme): Add collapsible sections for parameters in ONVIFClient documentation
1 parent 671992a commit 92fb83f

File tree

2 files changed

+60
-19
lines changed

2 files changed

+60
-19
lines changed

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
113113

114114
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:
115115

116-
### Basic Parameters
116+
117+
<details>
118+
<summary><b>Basic Parameters</b></summary>
117119

118120
| Parameter | Type | Required | Default | Description |
119121
|-----------|------|----------|---------|-------------|
@@ -122,41 +124,56 @@ The `ONVIFClient` class provides various configuration options to customize the
122124
| `username` | `str` | ✅ Yes | - | Username for device authentication (use digest authentication) |
123125
| `password` | `str` | ✅ Yes | - | Password for device authentication |
124126

125-
### Connection Parameters
127+
</details>
128+
129+
<details>
130+
<summary><b>Connection Parameters</b></summary>
126131

127132
| Parameter | Type | Required | Default | Description |
128133
|-----------|------|----------|---------|-------------|
129134
| `timeout` | `int` | ❌ No | `10` | Connection timeout in seconds for SOAP requests |
130135
| `use_https` | `bool` | ❌ No | `False` | Use HTTPS instead of HTTP for secure communication |
131136
| `verify_ssl` | `bool` | ❌ No | `True` | Verify SSL certificates when using HTTPS (set to `False` for self-signed certificates) |
132137

133-
### Caching Parameters
138+
</details>
139+
140+
<details>
141+
<summary><b>Caching Parameters</b></summary>
134142

135143
| Parameter | Type | Required | Default | Description |
136144
|-----------|------|----------|---------|-------------|
137145
| `cache` | `CacheMode` | ❌ No | `CacheMode.ALL` | WSDL caching strategy (see [Cache Modes](#cache-modes) below) |
138146

139-
### Feature Parameters
147+
</details>
148+
149+
<details>
150+
<summary><b>Feature Parameters</b></summary>
140151

141152
| Parameter | Type | Required | Default | Description |
142153
|-----------|------|----------|---------|-------------|
143-
| `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better xsd:any field parsing and automatic flattening |
154+
| `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better `xsd:any` field parsing and automatic flattening |
144155
| `capture_xml` | `bool` | ❌ No | `False` | Enable XML capture plugin for debugging SOAP requests/responses |
145156

146-
### Cache Modes
157+
</details>
158+
159+
<details>
160+
<summary><b>Cache Modes</b></summary>
147161

148162
The library provides four caching strategies via the `CacheMode` enum:
149163

150164
| Mode | Description | Best For | Startup Speed | Disk Usage | Memory Usage |
151165
|------|-------------|----------|---------------|------------|--------------|
152-
| `CacheMode.ALL` | In-memory + disk cache (SQLite) | Production servers, multi-device apps | ⚡⚡⚡ Fast | 💾 High | 🧠 High |
153-
| `CacheMode.DB` | Disk cache only (SQLite) | Batch jobs, CLI tools | ⚡⚡ Medium | 💾 Medium | 🧠 Low |
154-
| `CacheMode.MEM` | In-memory cache only | Short-lived scripts, demos | ⚡⚡ Medium | 💾 None | 🧠 Medium |
155-
| `CacheMode.NONE` | No caching | Testing, debugging | Slow | 💾 None | 🧠 Low |
166+
| `CacheMode.ALL` | In-memory + disk cache (SQLite) | Production servers, multi-device apps | Fast | High | High |
167+
| `CacheMode.DB` | Disk cache only (SQLite) | Batch jobs, CLI tools | Medium | Medium | Low |
168+
| `CacheMode.MEM` | In-memory cache only | Short-lived scripts, demos | Medium | None | Medium |
169+
| `CacheMode.NONE` | No caching | Testing, debugging | Slow | None | Low |
156170

157171
**Recommendation:** Use `CacheMode.ALL` (default) for production applications to maximize performance.
158172

159-
### Usage Examples
173+
</details>
174+
175+
<details>
176+
<summary><b>Usage Examples</b></summary>
160177

161178
**Basic Connection:**
162179
```python
@@ -267,8 +284,11 @@ if client.xml_plugin:
267284
> - `save_to_file(request_file, response_file)` - Save XML to files
268285
> - `clear_history()` - Clear captured history
269286
287+
</details>
288+
289+
<details>
290+
<summary><b>Production Configuration</b></summary>
270291

271-
**Production Configuration:**
272292
```python
273293
from onvif import ONVIFClient, CacheMode
274294

@@ -286,6 +306,7 @@ client = ONVIFClient(
286306
capture_xml=False # Disable debug mode (default)
287307
)
288308
```
309+
</details>
289310

290311
### Notes
291312

README_ID.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ Jelajahi penggunaan lanjutan dan operasi spesifik layanan di folder [`examples/`
113113

114114
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:
115115

116-
### Parameter Dasar
116+
<details>
117+
<summary><b>Parameter Dasar</b></summary>
117118

118119
| Parameter | Tipe | Wajib | Default | Deskripsi |
119120
|-----------|------|-------|---------|-----------|
@@ -122,28 +123,40 @@ Kelas `ONVIFClient` menyediakan berbagai opsi konfigurasi untuk menyesuaikan per
122123
| `username` | `str` | ✅ Ya | - | Nama pengguna untuk autentikasi perangkat (menggunakan digest authentication) |
123124
| `password` | `str` | ✅ Ya | - | Kata sandi untuk autentikasi perangkat |
124125

125-
### Parameter Koneksi
126+
</details>
127+
128+
<details>
129+
<summary><b>Parameter Koneksi</b></summary>
126130

127131
| Parameter | Tipe | Wajib | Default | Deskripsi |
128132
|-----------|------|-------|---------|-----------|
129133
| `timeout` | `int` | ❌ Tidak | `10` | Timeout koneksi dalam detik untuk permintaan SOAP |
130134
| `use_https` | `bool` | ❌ Tidak | `False` | Gunakan HTTPS sebagai pengganti HTTP untuk komunikasi aman |
131135
| `verify_ssl` | `bool` | ❌ Tidak | `True` | Verifikasi sertifikat SSL saat menggunakan HTTPS (set ke `False` untuk sertifikat self-signed) |
132136

133-
### Parameter Caching
137+
</details>
138+
139+
<details>
140+
<summary><b>Parameter Caching</b></summary>
134141

135142
| Parameter | Tipe | Wajib | Default | Deskripsi |
136143
|-----------|------|-------|---------|-----------|
137144
| `cache` | `CacheMode` | ❌ Tidak | `CacheMode.ALL` | Strategi caching WSDL (lihat [Mode Cache](#mode-cache) di bawah) |
138145

139-
### Parameter Fitur
146+
</details>
147+
148+
<details>
149+
<summary><b>Parameter Fitur</b></summary>
140150

141151
| Parameter | Tipe | Wajib | Default | Deskripsi |
142152
|-----------|------|-------|---------|-----------|
143153
| `apply_patch` | `bool` | ❌ Tidak | `True` | Aktifkan patching zeep untuk parsing field xsd:any yang lebih baik dan flattening otomatis |
144154
| `capture_xml` | `bool` | ❌ Tidak | `False` | Aktifkan plugin XML capture untuk debugging permintaan/respons SOAP |
145155

146-
### Mode Cache
156+
</details>
157+
158+
<details>
159+
<summary><b>Mode Cache</b></summary>
147160

148161
Pustaka menyediakan empat strategi caching melalui enum `CacheMode`:
149162

@@ -156,7 +169,10 @@ Pustaka menyediakan empat strategi caching melalui enum `CacheMode`:
156169

157170
**Rekomendasi:** Gunakan `CacheMode.ALL` (default) untuk aplikasi produksi guna memaksimalkan performa.
158171

159-
### Contoh Penggunaan
172+
</details>
173+
174+
<details>
175+
<summary><b>Contoh Penggunaan</b></summary>
160176

161177
**Koneksi Dasar:**
162178
```python
@@ -267,8 +283,11 @@ if client.xml_plugin:
267283
> - `save_to_file(request_file, response_file)` - Simpan XML ke file
268284
> - `clear_history()` - Bersihkan riwayat yang ditangkap
269285
286+
</details>
287+
288+
<details>
289+
<summary><b>Konfigurasi Produksi</b></summary>
270290

271-
**Konfigurasi Produksi:**
272291
```python
273292
from onvif import ONVIFClient, CacheMode
274293

@@ -286,6 +305,7 @@ client = ONVIFClient(
286305
capture_xml=False # Nonaktifkan mode debug (default)
287306
)
288307
```
308+
</details>
289309

290310
### Catatan
291311

0 commit comments

Comments
 (0)