Skip to main content

Aula

PyPI Python License

Unofficial async Python client for the Danish school platform aula.dk. The project delivers:

  1. Async Python API client — programmatic access to profiles, messages, calendar, posts, and more
  2. CLI — read messages, calendar, posts, presence, and widget data from the terminal
  3. AI agent skill — teach Claude Code or OpenCode to query school data

Table of Contents

Installation

pip install aula
# or with uv
uv add aula

Requirements: Python >= 3.14, MitID username and MitID app.

Run without installing

Use uvx to run the CLI directly from PyPI without a permanent install:

uvx aula --username johndoe messages --limit 5

Install from Source

git clone https://github.com/nickknissen/aula.git
cd aula
pip install -e .

Quick Start

import asyncio
from aula import FileTokenStorage
from aula.auth_flow import authenticate_and_create_client

async def main():
    token_storage = FileTokenStorage(".aula_tokens.json")
    async with await authenticate_and_create_client("your_mitid_username", token_storage) as client:
        profile = await client.get_profile()
        print(profile.display_name)
        for child in profile.children:
            overview = await client.get_daily_overview(child.id)

asyncio.run(main())

Key methods on AulaApiClient: get_profile(), get_daily_overview(child_id), get_message_threads(), get_messages_for_thread(thread_id), get_calendar_events(...), get_posts(...), get_groups(...), get_message_folders(...), search(...), update_presence_template(...), update_presence_status(...), get_profile_master_data(...), get_secure_documents(...), get_consent_responses(...), get_auto_reply(), get_vacation_registrations(...), get_notification_settings(), keep_alive(). See src/aula/api_client.py for the full list.

Widget API (Namespace)

Widget integrations are available via the namespaced widgets client on AulaApiClient:

tasks = await client.widgets.get_mu_tasks(
    widget_id="0030",  # WIDGET_MIN_UDDANNELSE_TASKS
    child_filter=["12345"],
    institution_filter=["5678"],
    week="2026-W8",
    session_uuid="guardian-user-id",
)

Use the client.widgets.* namespace for widget calls (for example: get_mu_tasks, get_ugeplan, get_easyiq_weekplan, get_meebook_weekplan, get_momo_courses, get_library_status).

Legacy direct widget methods on AulaApiClient are deprecated and will be removed in a future release. Migrate to client.widgets.<method>(...).

Authentication

What You Need

  • MitID username — your MitID username (not your Aula username). Find it at mitid.dk.
  • A MitID authenticator — either the MitID app on your phone, or a MitID kodeviser (code display device) plus your MitID password.

Authentication Methods

Pick with --auth-method (or the AULA_AUTH_METHOD env var):

Method Flag What happens
MitID app --auth-method app (default) QR codes are printed in the terminal for you to scan. If your app asks for a code instead of a scan, that code is printed too.
MitID kodeviser --auth-method token You're asked for the 6 digits on your kodeviser, then your MitID password.

MitID chip and audio code readers (kodeoplæser) are not supported. If your account offers one, it's listed in a warning at -v and the login falls back to whatever else you have.

First Login

On first run you'll be prompted to approve the login. Tokens are saved to the storage file and reused on subsequent runs — no authenticator interaction needed until they expire.

For the kodeviser method you can skip the prompts:

export AULA_MITID_PASSWORD='...'      # or --password
aula --auth-method token --token-code 123456 messages

The kodeviser code rotates, so --token-code is only useful for a single run. The password is never written to the config file; supply it per-run or via the environment.

Token Security

Tokens provide full access to your Aula account — treat them like passwords and never commit token files to version control.

How It Works

For a detailed breakdown of the authentication flow (OAuth + SAML + MitID), session cookies, and how this library differs from the browser login, see docs/aula-authentication.md.

CLI

Install as a standalone tool:

# with uv (recommended)
uv tool install aula

# or with pip
pip install aula

Then run:

aula --username <your_mitid_username> [COMMAND]

The username can also be set via the AULA_MITID_USERNAME environment variable or a config file.

Core

Command Description
aula login Verify credentials
aula profile Show profile and children
aula profile-details Extended profile info (email, phone, address)
aula overview Daily overview for all children
aula daily-summary Today's schedule, homework & messages
aula weekly-summary Full week overview with provider data

Messages

Command Description
aula messages Recent message threads
aula auto-reply View auto-reply status
aula contacts Contact list
aula notifications Recent notifications
aula notification-settings View notification preferences
aula search Search documents across Aula

Calendar

Command Description
aula calendar Calendar events
aula important-dates Important dates
aula birthdays Birthday events
aula vacations Vacation registrations

Presence

Command Description
aula presence Presence registrations and states
aula presence-templates Planned entry/exit times
aula update-presence Update pickup/drop-off times
aula report-sick Report a child sick today, or take it back (--undo)

Content

Command Description
aula posts Posts and announcements
aula groups Groups and group members (--search to search by name)
aula documents Secure documents (--common for institution files)
aula consents Consent responses
aula download-images Download images from gallery/posts/messages

Widgets

Command Description
aula widgets List available widgets
aula mu:opgaver Min Uddannelse tasks
aula mu:ugeplan Min Uddannelse weekly letter
aula easyiq:ugeplan EasyIQ weekly plan
aula easyiq:homework EasyIQ homework
aula meebook:ugeplan Meebook weekly plan
aula momo:forløb MoMo courses
aula momo:huskeliste MoMo reminders
aula library:status Library loans & reservations

Global flags

Flag Description
--username MitID username (or AULA_MITID_USERNAME env var)
--output text|json Output format (or AULA_OUTPUT env var)
--auth-method app|token MitID auth method (or AULA_AUTH_METHOD env var)
--password MitID password for --auth-method token (or AULA_MITID_PASSWORD env var)
--token-code 6 digits from your MitID kodeviser (or AULA_MITID_TOKEN_CODE env var)
-v / -vv / -vvv Increase verbosity (warning / info / debug)

JSON output

All commands support --output json for machine-readable output:

aula --output json messages --unread
aula --output json daily-summary --child "Emma"
aula --output json calendar --start-date 2026-03-10

Examples

aula --username johndoe messages --limit 5
# or without installing
uvx aula --username johndoe messages --limit 5

Configuration

~/.config/aula/config.json:

{
  "mitid_username": "your_mitid_username"
}

The username is saved automatically on first login. CLI flags and environment variables take precedence over the config file.

AI Agent Integration

The CLI is designed to work with AI coding agents like Claude Code and OpenCode. The agent-setup command installs a skill that teaches agents how to query Aula for school data.

# Install for the current project
aula agent-setup

# Install globally (all projects)
aula agent-setup --global

This creates a SKILL.md following the Agent Skills open standard under .claude/skills/aula/, which is read by both Claude Code and OpenCode. Once installed, agents can invoke /aula or automatically use the CLI when you ask about school data.

Project Structure

src/aula/
  api_client.py             # Async API client (main entry point)
  cli.py                    # Click CLI commands
  auth_flow.py              # High-level auth orchestration
  config.py                 # CLI config (~/.config/aula/config.json)
  token_storage.py          # Token persistence (ABC + file impl)
  auth/                     # MitID authentication
    mitid_client.py         # 7-step OAuth+SAML+MitID flow
    browser_client.py       # Low-level MitID protocol (QR, OTP, SRP)
    srp.py                  # Secure Remote Password with AES-GCM
  models/                   # API data models (one file per model)
  utils/                    # HTML helpers, table rendering, downloads
tests/                      # Mirrors src/aula/ structure

Attribution

  • Aula API usage was inspired by the scaarup/aula Home Assistant integration.
  • MitID authentication was inspired by the Hundter/MitID-BrowserClient project.
  • EasyIQ widget integration (weekplan and homework) was inspired by the esbenwiberg/easyiq Home Assistant integration.
  • Additional API endpoints were discovered via the eisbaw/aulalibre Rust client, which reverse-engineered the Aula Android app.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aula-1.9.0.tar.gz (221.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aula-1.9.0-py3-none-any.whl (141.9 kB view details)

Uploaded Python 3

File details

Details for the file aula-1.9.0.tar.gz.

File metadata

  • Download URL: aula-1.9.0.tar.gz
  • Upload date:
  • Size: 221.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aula-1.9.0.tar.gz
Algorithm Hash digest
SHA256 b907e85803949d89253db00f4470993a151f4d494214279d679899049fe7c4cb
MD5 cc382f5579cd710a5ba87232175191df
BLAKE2b-256 8b5c7ca76c158266c85e690a30a4769149c472e4d77e12abe568a6f3c401a000

See more details on using hashes here.

Provenance

The following attestation bundles were made for aula-1.9.0.tar.gz:

Publisher: publish.yml on nickknissen/aula

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aula-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: aula-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 141.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aula-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7fd229fff554cb045cc2f21e194a15d1a03c567a38b489579e6e2f45be602e6
MD5 d02453ec6549977784c30b3e790fae25
BLAKE2b-256 070be5c2d6e7c03b869fd3a7a65b7a3b707f966075d01ea1fe0952425a548244

See more details on using hashes here.

Provenance

The following attestation bundles were made for aula-1.9.0-py3-none-any.whl:

Publisher: publish.yml on nickknissen/aula

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.10.0

2 files

1.9.1

2 files

This release

1.9.0 This release

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.3

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page