Skip to main content

awlise

An async Python API wrapper for the Alise school meal booking platform (webparent.paiementdp.com).

This library is not affiliated with Alise in any way.

Alise does not publish an official API — it only serves HTML pages. awlise logs in, sends the right requests, and scrapes the responses (aiohttp + BeautifulSoup4) into typed pydantic models, so you don't have to.

Installation

pip install awlise

Quick start

import asyncio
from awlise import AliseClient


async def main():
    client = await AliseClient.from_credentials(
        site_id="12345", username="user", password="password"
    )

    account = await client.get_account()
    print(account.responsable, account.balance)

    bookings = await client.list_bookings()
    for booking in bookings:
        print(booking.date, booking.status)

    available = next(b for b in bookings if b.status == "available")
    await client.book_meal(available.identifier)


asyncio.run(main())

You can also log in with a pre-issued token instead of credentials:

client = await AliseClient.from_token(site_id="12345", token="...")

API overview

Every method on AliseClient maps to one domain of the platform:

Method Description
AliseClient.from_credentials(site_id, username, password) Log in and return a ready-to-use client
AliseClient.from_token(site_id, token) Log in with a pre-issued token
client.get_account() Account holder info, balance, currently selected child
client.list_bookings() Every day on the booking calendar and its status
client.get_booking(identifier) A single booking by its identifier
client.get_booking_by_date(date) A single booking by ISO 8601 date (YYYY-MM-DD)
client.book_meal(identifier, quantity=1) Book a meal for a given day
client.cancel_meal(identifier) Cancel an existing booking
client.list_transactions() Debit/credit history of the account
client.get_meal_price() Price of a single canteen meal (not the account balance)

client.session gives you the underlying Session (session_id, site_id, fetcher) if you need to persist or inspect it.

Functional API

Every client method is a thin wrapper around a free function that takes a Session explicitly — useful if you want to manage sessions yourself (e.g. store one per user) instead of holding an AliseClient instance:

from awlise import login_with_credentials, get_account, list_bookings, book_meal

session = await login_with_credentials(site_id, username, password)
account = await get_account(session)
bookings = await list_bookings(session)

These are the same functions AliseClient calls internally — nothing is duplicated between the two styles.

Custom fetcher

Every login function accepts a fetcher callable if you want to swap out the default aiohttp-based transport (for testing, proxies, retries, etc.):

async def my_fetcher(request):
    ...  # perform the HTTP call yourself, return {"status", "headers", "bytes", "text"}

client = await AliseClient.from_credentials(site_id, username, password, fetcher=my_fetcher)

Errors

All exceptions inherit from awlise.AwliseError: AuthenticationError, AccountError, BookingError, TransactionError, PaymentError, plus the lower-level RequestError and FetcherError.

from awlise import AliseClient, AuthenticationError

try:
    client = await AliseClient.from_credentials(site_id, username, password)
except AuthenticationError:
    print("Wrong credentials or unknown site ID")

Documentation

See docs/alise-api.md for a reverse-engineered reference of the raw HTTP endpoints this library wraps — useful if you need to debug a parsing issue or extend the library.

Development

pip install -e .
flake8 awlise/

Tests are standalone scripts (not pytest) that hit the real platform, and require a .env file with ALISE_USERNAME, ALISE_PASSWORD, and ALISE_SITE_ID:

python awlise/tests/login.py
python awlise/tests/bookings.py
python awlise/tests/book_meal.py
python awlise/tests/transactions.py
python awlise/tests/payments.py

License

GPL-3.0-or-later.

Release files for awlise 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awlise 2.1.0
File Size Uploaded
awlise-2.1.0.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awlise 2.1.0
File Interpreter ABI Platform
awlise-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / awlise-2.1.0.tar.gz

Download URL awlise-2.1.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dd7d566617c45c04f965d2a48e75247a5685d52fff87be8cc64460fece9f0593
BLAKE2b-256 checksum
How to use checksums
4ff14d439593764967fe761b7c2f910540f9f7cd03b3b70ce2a360a5dfe9ce58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / awlise-2.1.0-py3-none-any.whl

Download URL awlise-2.1.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b2ca4814805694322a19b016d5cba61872ab768f39dfbfc8dd33f80f20ffd57
BLAKE2b-256 checksum
How to use checksums
1f696e4794998395f4e115fb5d27a9db345de6b432a2df197bc767fbe2a4d80a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release 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