Command-line interface for Wilma school portal
Project description
Wilma CLI
A command-line interface for the Wilma school platform. This CLI allows you to authenticate, list messages, and view message contents from the Wilma platform using both regular and interactive modes.
Features
- Command-line interface with typer and rich
- Interactive terminal UI for browsing and reading messages
- Message summarization using Claude AI
- Supports environment variables for configuration
Installation
# Using pip
pip install wilhelminacli
pip install playwright
playwright install chromium
# Using Poetry
poetry add wilhelminacli
poetry run playwright install chromium
Configuration
You can configure the client using a .env file in your project root directory. Create one by copying the example file:
cp .env.example .env
Then edit the file with your credentials:
WILMA_USERNAME=your_username
WILMA_PASSWORD=your_password
WILMA_BASE_URL=https://your-school.inschool.fi # Optional
ANTHROPIC_API_KEY=your_api_key # For message summarization
CLI Usage
The package includes a command-line interface for easy testing and usage:
# Login to test credentials
wilma login
# Login with credentials from .env file
wilma login
# List messages (use --no-headless to see the browser)
wilma messages --no-headless
# Show a specific message
wilma message 12345
# Debug mode with visible browser
wilma messages --debug --no-headless
# Interactive mode with message browser UI
wilma messages -i
# Show only unread messages
wilma messages --unread
# Summarize unread messages with AI
wilma messages-summarize
Interactive Mode
The interactive mode (-i flag) provides a terminal-based UI for browsing and reading messages:
- Navigate the message list using arrow keys
- Select a message with Enter to view its full content
- Press Escape or 'b' to go back from message detail to the message list
- Press Escape or 'q' to quit from the message list
Features of the interactive UI:
- Full-screen terminal interface
- Unread messages highlighted in green
- Message content displayed with proper formatting
- Navigation between message list and message detail screens
AI Message Summarization
The CLI includes optional AI-powered message summarization using Anthropic's Claude API:
# Summarize a specific message
wilma message 12345 --summarize
# Summarize all unread messages
wilma messages-summarize
To use the summarization feature, you need to set the ANTHROPIC_API_KEY environment variable in your .env file.
Development
Setup
# Clone the repository
git clone https://github.com/frwickst/wilhelminacli.git
cd wilhelminacli
# Install development dependencies
poetry install
# Install Playwright browser
poetry run playwright install chromium
Running Tests
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=wilhelminacli
Linting and Type Checking
# Format with ruff
poetry run ruff format wilhelminacli
# Run ruff for linting
poetry run ruff check wilhelminacli --fix
# Run mypy for type checking
poetry run mypy wilhelminacli
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wilhelminacli-0.1.0.tar.gz.
File metadata
- Download URL: wilhelminacli-0.1.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.10 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c25f7aab213ee744048c31cb2099bb9c8b35a9121b6e35604e18dd1564066658
|
|
| MD5 |
a0bf71bf3109f2db448593fefb2003ff
|
|
| BLAKE2b-256 |
7a6f8b8bd6d2f00e140397108e44c26d4381020029c548f1171260e41cbb1242
|
File details
Details for the file wilhelminacli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wilhelminacli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.10 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb070169a28d1a3b5a5c1023cc83c5025404ab3293a8775a1625ce0db4981045
|
|
| MD5 |
fda31f74be55559a370ee794df57efdf
|
|
| BLAKE2b-256 |
3c10c18963161c4ca0add72eb6cb2c5217badcf935ebfa48803df6921b33e562
|