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.
- Services Management: List and view details of all available services in the camp, including contact information and locations.
- Event Management: Browse upcoming and past events, with detailed information about registration, dates, and locations.
- Photo Archive: Upload and browse photos from the camp, with support for metadata and descriptions.
- Population Statistics: Access detailed demographic data, including population trends, nationalities, and demographics.
- Resource Library: Download and manage digital resources, including documents, reports, and media files.
- API Health Monitoring: Comprehensive health checks for all API endpoints with detailed response analysis.
- Rich Terminal Output: Beautiful, colorized tables and panels for easy data visualization.
- Configurable Settings: Customize API URL and timeout settings to match your environment.
- Batch Operations: Download multiple resources or upload multiple photos in batch.
- Data Export: Export data to CSV format or generate detailed markdown reports.
- Search Functionality: Search across all resources with filtering and relevance sorting.
- Interactive Shell: Command-line interface with history, tab completion, and command suggestions.
git clone https://github.com/Dzaleka-Connect/dzdk-cli.git
cd dzdk-clipython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtpip install -e .The CLI stores its configuration in ~/.dzdk/config.yaml. You can modify these settings:
- API URL: Base URL for the API (default: https://services.dzaleka.com/api)
- Timeout: Request timeout in seconds (default: 30)
# Set custom API URL
dzdk config --url "https://services.dzaleka.com/api"
# Set custom timeout
dzdk config --timeout 30
# Update both settings
dzdk config --url "https://services.dzaleka.com/api" --timeout 30Show and update CLI configuration settings:
# Show current configuration
dzdk show_config
# Interactive configuration mode
dzdk config --interactive
# Set API URL
dzdk config --url "https://services.dzaleka.com/api"
# Set request timeout
dzdk config --timeout 30You can also update both settings at once:
dzdk config --url "https://services.dzaleka.com/api" --timeout 30This will update the configuration file at ~/.config/dzdk/config.yaml.
Check the health of all API endpoints with detailed response analysis:
dzdk healthThis command provides:
- Response status codes
- Response times
- Response types (JSON/Non-JSON)
- Error messages if any
List all available services with detailed information:
# Basic list (12 items per page)
dzdk services list
# Navigate to specific page
dzdk services list --page 2
# Search for specific services
dzdk services list --search "health"
# Filter by category
dzdk services list --category "medical"
# Filter by status
dzdk services list --status active
# Sort results
dzdk services list --sort-by category --sort-order desc
# Combine filters with pagination
dzdk services list --search "clinic" --category "medical" --status active --page 1Service details include:
- Service title and description
- Category and status
- Contact information (email, phone)
- Website information
- Status indicators (active/inactive/unknown)
- Total count of matching services
- Active filters display
- Page navigation (12 items per page)
Search and Filter Options:
- Search: Search across title, description, and category
- Category: Filter by specific service category
- Status: Filter by service status (active/inactive/unknown)
- Sort By: Sort results by title, category, or status
- Sort Order: Choose ascending or descending order
Get information about a specific service:
dzdk services get --id <service_id_or_slug>Service details include:
- Service title and description
- Category and status
- Location details (address, city)
- Contact information (email, phone)
- Operating hours
- Additional metadata
List all events with key information:
# Basic list (12 items per page)
dzdk events list
# Navigate to specific page
dzdk events list --page 2
# Search and filter with pagination
dzdk events list --search "workshop" --category "education" --page 1
# Sort with pagination
dzdk events list --sort-by date --sort-order desc --page 1Get detailed information about a specific event:
dzdk events get --id <event_id_or_slug>Event details include:
- Title and description
- Date and time
- Location
- Registration information
- Contact details
- Tags and categories
List all available photos:
# Basic list (12 items per page)
dzdk photos list
# Navigate to specific page
dzdk photos list --page 2
# Search and filter with pagination
dzdk photos list --search "camp" --category "events" --page 1
# Sort with pagination
dzdk photos list --sort-by date --sort-order desc --page 1Get information about a specific photo:
dzdk photos get --id <photo_id_or_slug>Photo details include:
- Title and description
- Date taken
- Photographer information
- Location
- Tags and categories
- Image metadata (size, format)
- Download URL
Upload a photo to the archive:
dzdk photos upload --file path/to/image.jpg --title "Photo Title" --description "Optional description"Edit photo metadata:
dzdk photos edit --id <photo_id> --title "New Title" --description "New Description" --tags "tag1,tag2" --location "New Location" --date "2024-03-20"View detailed photo metadata:
dzdk photos metadata --id <photo_id>Create a new album:
dzdk photos album create --name "My Album" --description "Album Description" --tags "tag1,tag2"Add photos to an album:
dzdk photos album add --album-id <album_id> --photo-ids "photo1,photo2,photo3"List all albums:
dzdk photos album listFeatures:
- Album creation and management
- Photo organization
- Tag-based categorization
- Rich metadata display
- Batch photo operations
- Technical metadata viewing
- Location and date tracking
Get comprehensive population statistics:
dzdk population statsGet specific demographic information:
dzdk population get --category <demographic_category>Available categories:
- age_groups
- nationalities
- gender
- new_arrivals
- historical_trends
Statistics include:
- Total population
- New arrivals
- Demographics breakdown
- Nationality distribution
- Historical trends
List all available resources:
# Basic list (12 items per page)
dzdk resources list
# Navigate to specific page
dzdk resources list --page 2
# Search and filter with pagination
dzdk resources list --search "report" --category "research" --page 1
# Sort with pagination
dzdk resources list --sort-by date --sort-order desc --page 1Get detailed information about a specific resource:
dzdk resources get --id <resource_id_or_slug>Resource information includes:
- Title and description
- Author and date
- File type and size
- Available languages
- Download URLs
- Version history
- Related resources
Download a resource:
dzdk resources fetch --id <resource_id_or_slug> --output filename.pdfSearch across all resources with filtering and relevance sorting:
# Search across all content types
dzdk search --query "education"
# Search only in services
dzdk search --query "health" --type services
# Search with a custom result limit
dzdk search --query "event" --limit 20Features:
- Cross-resource search
- Type filtering
- Relevance sorting
- Result limiting
- Rich output formatting
Download multiple resources or photos in batch:
# Download multiple resources
dzdk batch download --type resources --ids "id1,id2,id3" --output-dir downloads
# Download multiple photos
dzdk batch download --type photos --ids "photo1,photo2" --output-dir photosFeatures:
- Parallel downloads
- Progress tracking
- Error handling
- Automatic directory creation
Upload multiple photos from a directory:
# Upload all photos from a directory
dzdk batch upload --type photos --directory ./my_photosFeatures:
- Batch processing
- File validation
- Progress tracking
- Error handling
Export data to CSV format:
# Export services to CSV
dzdk export csv --type services --output services.csv
# Export population data to CSV
dzdk export csv --type population --output population.csvFeatures:
- Flattened data structure
- Preserved metadata
- Proper CSV formatting
Generate detailed markdown reports:
# Generate a services report
dzdk export report --type services --output services_report.md
# Generate a population report
dzdk export report --type population --output population_report.mdFeatures:
- Comprehensive summaries
- Detailed item information
- Formatted markdown output
- Timestamps and metadata
Start an interactive shell session with command history and tab completion:
dzdk shellFeatures:
- Command history persistence
- Tab completion for commands
- Command suggestions based on history
- Rich output formatting
- Built-in help system
- Screen clearing
- Easy command execution
Example shell session:
(dzdk) help
(dzdk) services list
(dzdk) photos upload --file photo.jpg --title "My Photo"
(dzdk) search --query "education"
(dzdk) clear
(dzdk) exitShell Commands:
help [command]: Show help informationclear: Clear the terminal screenexit: Exit the shell- All regular CLI commands are available
The CLI uses the Rich library to provide beautiful, colorized output:
- Tables: Organized data presentation with color-coded columns
- Panels: Detailed information in bordered boxes
- Progress Bars: Visual feedback for long-running operations
- Status Indicators: Color-coded success/error messages
- Visualizations: Bar charts and graphs for data representation
- Search Results: Formatted panels with type-specific details
- Follow the existing code structure
- Add proper error handling
- Include progress indicators for long operations
- Add appropriate documentation
- Update the README with new commands
- Run the test suite:
pytest - Test new features thoroughly
- Verify error handling
- Check output formatting
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Update documentation
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact:
- Email: contact@mail.dzaleka.com
- Website: https://services.dzaleka.com