dzdk 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,502 @@
1
+ Metadata-Version: 2.4
2
+ Name: dzdk
3
+ Version: 0.1.0
4
+ Summary: Dzaleka Digital Heritage CLI - A command-line interface for interacting with the Dzaleka Digital Heritage API
5
+ Project-URL: Homepage, https://github.com/Dzaleka-Connect/dzdk-cli
6
+ Project-URL: Documentation, https://services.dzaleka.com/docs/dzdk-cli
7
+ Project-URL: Repository, https://github.com/Dzaleka-Connect/dzdk-cli.git
8
+ Project-URL: Issues, https://github.com/Dzaleka-Connect/dzdk-cli/issues
9
+ Author-email: Bakari <bakari@mail.dzaleka.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.8
23
+ Requires-Dist: click>=8.0.0
24
+ Requires-Dist: pandas>=1.3.0
25
+ Requires-Dist: prompt-toolkit>=3.0.0
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: requests>=2.25.0
28
+ Requires-Dist: rich>=10.0.0
29
+ Requires-Dist: tabulate>=0.8.9
30
+ Description-Content-Type: text/markdown
31
+
32
+ # dzdk - Dzaleka Digital Heritage CLI
33
+
34
+ A command-line interface for interacting with the Dzaleka Digital Heritage API, providing rich, colorized output and comprehensive access to the camp's digital resources.
35
+
36
+ ---
37
+
38
+ ## Features
39
+ - **Services Management**: List and view details of all available services in the camp, including contact information and locations.
40
+ - **Event Management**: Browse upcoming and past events, with detailed information about registration, dates, and locations.
41
+ - **Photo Archive**: Upload and browse photos from the camp, with support for metadata and descriptions.
42
+ - **Population Statistics**: Access detailed demographic data, including population trends, nationalities, and demographics.
43
+ - **Resource Library**: Download and manage digital resources, including documents, reports, and media files.
44
+ - **API Health Monitoring**: Comprehensive health checks for all API endpoints with detailed response analysis.
45
+ - **Rich Terminal Output**: Beautiful, colorized tables and panels for easy data visualization.
46
+ - **Configurable Settings**: Customize API URL and timeout settings to match your environment.
47
+ - **Batch Operations**: Download multiple resources or upload multiple photos in batch.
48
+ - **Data Export**: Export data to CSV format or generate detailed markdown reports.
49
+ - **Search Functionality**: Search across all resources with filtering and relevance sorting.
50
+ - **Interactive Shell**: Command-line interface with history, tab completion, and command suggestions.
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ### 1. Clone the Repository
57
+ ```bash
58
+ git clone https://github.com/Dzaleka-Connect/dzdk-cli.git
59
+ cd dzdk-cli
60
+ ```
61
+
62
+ ### 2. Create and Activate a Virtual Environment
63
+ ```bash
64
+ python3 -m venv venv
65
+ source venv/bin/activate # On Windows: venv\Scripts\activate
66
+ ```
67
+
68
+ ### 3. Install Dependencies
69
+ ```bash
70
+ pip install -r requirements.txt
71
+ ```
72
+
73
+ ### 4. Install the CLI in Editable Mode
74
+ ```bash
75
+ pip install -e .
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Configuration
81
+
82
+ The CLI stores its configuration in `~/.dzdk/config.yaml`. You can modify these settings:
83
+
84
+ - **API URL**: Base URL for the API (default: https://services.dzaleka.com/api)
85
+ - **Timeout**: Request timeout in seconds (default: 30)
86
+
87
+ ### Update Configuration
88
+ ```bash
89
+ # Set custom API URL
90
+ dzdk config --url "https://services.dzaleka.com/api"
91
+
92
+ # Set custom timeout
93
+ dzdk config --timeout 30
94
+
95
+ # Update both settings
96
+ dzdk config --url "https://services.dzaleka.com/api" --timeout 30
97
+ ```
98
+
99
+ ### Configuration
100
+ Show and update CLI configuration settings:
101
+ ```bash
102
+ # Show current configuration
103
+ dzdk show_config
104
+
105
+ # Interactive configuration mode
106
+ dzdk config --interactive
107
+
108
+ # Set API URL
109
+ dzdk config --url "https://services.dzaleka.com/api"
110
+
111
+ # Set request timeout
112
+ dzdk config --timeout 30
113
+ ```
114
+
115
+ You can also update both settings at once:
116
+ ```bash
117
+ dzdk config --url "https://services.dzaleka.com/api" --timeout 30
118
+ ```
119
+
120
+ This will update the configuration file at `~/.config/dzdk/config.yaml`.
121
+
122
+ ---
123
+
124
+ ## Command Reference
125
+
126
+ ### Health Check
127
+ Check the health of all API endpoints with detailed response analysis:
128
+ ```bash
129
+ dzdk health
130
+ ```
131
+ This command provides:
132
+ - Response status codes
133
+ - Response times
134
+ - Response types (JSON/Non-JSON)
135
+ - Error messages if any
136
+
137
+ ### Services
138
+ List all available services with detailed information:
139
+ ```bash
140
+ # Basic list (12 items per page)
141
+ dzdk services list
142
+
143
+ # Navigate to specific page
144
+ dzdk services list --page 2
145
+
146
+ # Search for specific services
147
+ dzdk services list --search "health"
148
+
149
+ # Filter by category
150
+ dzdk services list --category "medical"
151
+
152
+ # Filter by status
153
+ dzdk services list --status active
154
+
155
+ # Sort results
156
+ dzdk services list --sort-by category --sort-order desc
157
+
158
+ # Combine filters with pagination
159
+ dzdk services list --search "clinic" --category "medical" --status active --page 1
160
+ ```
161
+
162
+ Service details include:
163
+ - Service title and description
164
+ - Category and status
165
+ - Contact information (email, phone)
166
+ - Website information
167
+ - Status indicators (active/inactive/unknown)
168
+ - Total count of matching services
169
+ - Active filters display
170
+ - Page navigation (12 items per page)
171
+
172
+ Search and Filter Options:
173
+ - **Search**: Search across title, description, and category
174
+ - **Category**: Filter by specific service category
175
+ - **Status**: Filter by service status (active/inactive/unknown)
176
+ - **Sort By**: Sort results by title, category, or status
177
+ - **Sort Order**: Choose ascending or descending order
178
+
179
+ Get information about a specific service:
180
+ ```bash
181
+ dzdk services get --id <service_id_or_slug>
182
+ ```
183
+ Service details include:
184
+ - Service title and description
185
+ - Category and status
186
+ - Location details (address, city)
187
+ - Contact information (email, phone)
188
+ - Operating hours
189
+ - Additional metadata
190
+
191
+ ### Events
192
+ List all events with key information:
193
+ ```bash
194
+ # Basic list (12 items per page)
195
+ dzdk events list
196
+
197
+ # Navigate to specific page
198
+ dzdk events list --page 2
199
+
200
+ # Search and filter with pagination
201
+ dzdk events list --search "workshop" --category "education" --page 1
202
+
203
+ # Sort with pagination
204
+ dzdk events list --sort-by date --sort-order desc --page 1
205
+ ```
206
+
207
+ Get detailed information about a specific event:
208
+ ```bash
209
+ dzdk events get --id <event_id_or_slug>
210
+ ```
211
+ Event details include:
212
+ - Title and description
213
+ - Date and time
214
+ - Location
215
+ - Registration information
216
+ - Contact details
217
+ - Tags and categories
218
+
219
+ ### Photos
220
+ List all available photos:
221
+ ```bash
222
+ # Basic list (12 items per page)
223
+ dzdk photos list
224
+
225
+ # Navigate to specific page
226
+ dzdk photos list --page 2
227
+
228
+ # Search and filter with pagination
229
+ dzdk photos list --search "camp" --category "events" --page 1
230
+
231
+ # Sort with pagination
232
+ dzdk photos list --sort-by date --sort-order desc --page 1
233
+ ```
234
+
235
+ Get information about a specific photo:
236
+ ```bash
237
+ dzdk photos get --id <photo_id_or_slug>
238
+ ```
239
+ Photo details include:
240
+ - Title and description
241
+ - Date taken
242
+ - Photographer information
243
+ - Location
244
+ - Tags and categories
245
+ - Image metadata (size, format)
246
+ - Download URL
247
+
248
+ Upload a photo to the archive:
249
+ ```bash
250
+ dzdk photos upload --file path/to/image.jpg --title "Photo Title" --description "Optional description"
251
+ ```
252
+
253
+ Edit photo metadata:
254
+ ```bash
255
+ dzdk photos edit --id <photo_id> --title "New Title" --description "New Description" --tags "tag1,tag2" --location "New Location" --date "2024-03-20"
256
+ ```
257
+
258
+ View detailed photo metadata:
259
+ ```bash
260
+ dzdk photos metadata --id <photo_id>
261
+ ```
262
+
263
+ ### Photo Albums
264
+ Create a new album:
265
+ ```bash
266
+ dzdk photos album create --name "My Album" --description "Album Description" --tags "tag1,tag2"
267
+ ```
268
+
269
+ Add photos to an album:
270
+ ```bash
271
+ dzdk photos album add --album-id <album_id> --photo-ids "photo1,photo2,photo3"
272
+ ```
273
+
274
+ List all albums:
275
+ ```bash
276
+ dzdk photos album list
277
+ ```
278
+
279
+ Features:
280
+ - Album creation and management
281
+ - Photo organization
282
+ - Tag-based categorization
283
+ - Rich metadata display
284
+ - Batch photo operations
285
+ - Technical metadata viewing
286
+ - Location and date tracking
287
+
288
+ ### Population
289
+ Get comprehensive population statistics:
290
+ ```bash
291
+ dzdk population stats
292
+ ```
293
+ Get specific demographic information:
294
+ ```bash
295
+ dzdk population get --category <demographic_category>
296
+ ```
297
+ Available categories:
298
+ - age_groups
299
+ - nationalities
300
+ - gender
301
+ - new_arrivals
302
+ - historical_trends
303
+
304
+ Statistics include:
305
+ - Total population
306
+ - New arrivals
307
+ - Demographics breakdown
308
+ - Nationality distribution
309
+ - Historical trends
310
+
311
+ ### Resources
312
+ List all available resources:
313
+ ```bash
314
+ # Basic list (12 items per page)
315
+ dzdk resources list
316
+
317
+ # Navigate to specific page
318
+ dzdk resources list --page 2
319
+
320
+ # Search and filter with pagination
321
+ dzdk resources list --search "report" --category "research" --page 1
322
+
323
+ # Sort with pagination
324
+ dzdk resources list --sort-by date --sort-order desc --page 1
325
+ ```
326
+
327
+ Get detailed information about a specific resource:
328
+ ```bash
329
+ dzdk resources get --id <resource_id_or_slug>
330
+ ```
331
+ Resource information includes:
332
+ - Title and description
333
+ - Author and date
334
+ - File type and size
335
+ - Available languages
336
+ - Download URLs
337
+ - Version history
338
+ - Related resources
339
+
340
+ Download a resource:
341
+ ```bash
342
+ dzdk resources fetch --id <resource_id_or_slug> --output filename.pdf
343
+ ```
344
+
345
+ ### Search
346
+ Search across all resources with filtering and relevance sorting:
347
+ ```bash
348
+ # Search across all content types
349
+ dzdk search --query "education"
350
+
351
+ # Search only in services
352
+ dzdk search --query "health" --type services
353
+
354
+ # Search with a custom result limit
355
+ dzdk search --query "event" --limit 20
356
+ ```
357
+ Features:
358
+ - Cross-resource search
359
+ - Type filtering
360
+ - Relevance sorting
361
+ - Result limiting
362
+ - Rich output formatting
363
+
364
+ ### Batch Operations
365
+ Download multiple resources or photos in batch:
366
+ ```bash
367
+ # Download multiple resources
368
+ dzdk batch download --type resources --ids "id1,id2,id3" --output-dir downloads
369
+
370
+ # Download multiple photos
371
+ dzdk batch download --type photos --ids "photo1,photo2" --output-dir photos
372
+ ```
373
+ Features:
374
+ - Parallel downloads
375
+ - Progress tracking
376
+ - Error handling
377
+ - Automatic directory creation
378
+
379
+ Upload multiple photos from a directory:
380
+ ```bash
381
+ # Upload all photos from a directory
382
+ dzdk batch upload --type photos --directory ./my_photos
383
+ ```
384
+ Features:
385
+ - Batch processing
386
+ - File validation
387
+ - Progress tracking
388
+ - Error handling
389
+
390
+ ### Export
391
+ Export data to CSV format:
392
+ ```bash
393
+ # Export services to CSV
394
+ dzdk export csv --type services --output services.csv
395
+
396
+ # Export population data to CSV
397
+ dzdk export csv --type population --output population.csv
398
+ ```
399
+ Features:
400
+ - Flattened data structure
401
+ - Preserved metadata
402
+ - Proper CSV formatting
403
+
404
+ Generate detailed markdown reports:
405
+ ```bash
406
+ # Generate a services report
407
+ dzdk export report --type services --output services_report.md
408
+
409
+ # Generate a population report
410
+ dzdk export report --type population --output population_report.md
411
+ ```
412
+ Features:
413
+ - Comprehensive summaries
414
+ - Detailed item information
415
+ - Formatted markdown output
416
+ - Timestamps and metadata
417
+
418
+ ### Interactive Shell
419
+ Start an interactive shell session with command history and tab completion:
420
+ ```bash
421
+ dzdk shell
422
+ ```
423
+
424
+ Features:
425
+ - Command history persistence
426
+ - Tab completion for commands
427
+ - Command suggestions based on history
428
+ - Rich output formatting
429
+ - Built-in help system
430
+ - Screen clearing
431
+ - Easy command execution
432
+
433
+ Example shell session:
434
+ ```bash
435
+ (dzdk) help
436
+ (dzdk) services list
437
+ (dzdk) photos upload --file photo.jpg --title "My Photo"
438
+ (dzdk) search --query "education"
439
+ (dzdk) clear
440
+ (dzdk) exit
441
+ ```
442
+
443
+ Shell Commands:
444
+ - `help [command]`: Show help information
445
+ - `clear`: Clear the terminal screen
446
+ - `exit`: Exit the shell
447
+ - All regular CLI commands are available
448
+
449
+ ---
450
+
451
+ ## Output Formatting
452
+
453
+ The CLI uses the Rich library to provide beautiful, colorized output:
454
+
455
+ - **Tables**: Organized data presentation with color-coded columns
456
+ - **Panels**: Detailed information in bordered boxes
457
+ - **Progress Bars**: Visual feedback for long-running operations
458
+ - **Status Indicators**: Color-coded success/error messages
459
+ - **Visualizations**: Bar charts and graphs for data representation
460
+ - **Search Results**: Formatted panels with type-specific details
461
+
462
+ ---
463
+
464
+ ## Development
465
+
466
+ ### Adding New Features
467
+ 1. Follow the existing code structure
468
+ 2. Add proper error handling
469
+ 3. Include progress indicators for long operations
470
+ 4. Add appropriate documentation
471
+ 5. Update the README with new commands
472
+
473
+ ### Testing
474
+ 1. Run the test suite: `pytest`
475
+ 2. Test new features thoroughly
476
+ 3. Verify error handling
477
+ 4. Check output formatting
478
+
479
+ ---
480
+
481
+ ## Contributing
482
+
483
+ 1. Fork the repository
484
+ 2. Create a feature branch
485
+ 3. Make your changes
486
+ 4. Add tests if applicable
487
+ 5. Update documentation
488
+ 6. Submit a pull request
489
+
490
+ ---
491
+
492
+ ## License
493
+
494
+ This project is licensed under the MIT License - see the LICENSE file for details.
495
+
496
+ ---
497
+
498
+ ## Contact
499
+
500
+ For questions or support, please contact:
501
+ - Email: contact@mail.dzaleka.com
502
+ - Website: https://services.dzaleka.com
@@ -0,0 +1,6 @@
1
+ dzdk.py,sha256=kX1BBdSao4ZZWqBPajNPpX2R3tKiVGw5BUlafUiGqmY,94246
2
+ dzdk-0.1.0.dist-info/METADATA,sha256=U1kr-qSyUyCUQlJSWNx-fXxS9qvVdV-lCMsjeWQ4nTw,12818
3
+ dzdk-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
+ dzdk-0.1.0.dist-info/entry_points.txt,sha256=j0M9E4AKUxtrzHoaI5yLxrucNUTm0r2uDhTIi8Izw9Y,34
5
+ dzdk-0.1.0.dist-info/licenses/LICENSE,sha256=jEE9LXgWtkDVjYb85484M8s54j2vhSqo4dBitFfF5tU,1081
6
+ dzdk-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dzdk = dzdk:cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Dzaleka Digital Heritage
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.