librus-rs
Rust client for Librus Synergia - the Polish school diary system.
Installation
Add to your Cargo.toml:
[]
= "2.0"
= { = "1", = ["full"] }
Quick Start
use Client;
async
Client Construction
Three ways to create a client:
use Client;
// From environment variables
let client = from_env.await?;
// With explicit credentials
let client = new.await?;
// Using the builder pattern
let client = builder
.username
.password
.build
.await?;
API Reference
Synergia API
Base URL: https://synergia.librus.pl/gateway/api/2.0/
| Method | Description |
|---|---|
me() |
Get current user info |
grades() |
Get all grades |
grade_category(id) |
Get grade category by ID |
grade_comment(id) |
Get grade comment by ID |
lesson(id) |
Get lesson info by ID |
subject(id) |
Get subject info by ID |
attendances() |
Get all attendances |
attendance_types() |
Get attendance types |
homeworks() |
Get all homeworks |
school_notices() |
Get school notices (announcements) |
school_notices_page(page, limit) |
Get school notices with pagination |
school_notices_latest(limit) |
Get latest notices (client-side sort) |
user(id) |
Get user by ID |
current_user() |
Get current user details |
Notes:
- Pagination is supported by
SchoolNotices(viapage/limitquery params).
Messages API
Base URL: https://wiadomosci.librus.pl/api/
| Method | Description |
|---|---|
unread_counts() |
Get unread message counts for all folders |
inbox_messages(page, limit) |
List received messages |
outbox_messages(page, limit) |
List sent messages |
message(id) |
Get full message details |
attachment(attachment_id, message_id) |
Download attachment as bytes |
decode_message_content(base64) |
Decode base64 message content to string |
notice_content_to_text(html) |
Convert API-provided notice HTML to text |
API Documentation
There is no official public documentation for the Synergia API. Community references:
- https://libraries.io/go/github.com%2Fgoferwplynie%2FlibrusApi (lists implemented endpoints; notes lack of official docs)
- https://ravensiris.github.io/librusapi/ (HTML-scraping docs; not official)
Error Handling
All methods return Result<T, librus_rs::Error>. Error variants:
Types
Key Exported Types
pub use ;
InboxMessage
MessageDetail
Development
For Nix users:
License
MIT