Welcome to pluxee-api’s documentation!

Introduction

The pluxee-api Python library (unofficial) provides easy access to Pluxee (Sodexo) balance and transaction data. This library allows users to retrieve information such as account balances and transaction history from the Pluxee platform. It offers both synchronous and asynchronous versions for installation.

Warning

Belgium only: I could only test this package using my belgian Sodexo card. It should not work for other countries. You can contact me if you need it to work for another country. I will happily improve this package with your help.

Installation

You can install pluxee-api via pip For normal install:

pip install pluxee-api

For asynchronous version:

pip install pluxee-api[async]

Alternatively, you can clone the repository from GitHub:

git clone git://github.com/Tib612/pluxee-api.git
cd pluxee-api
pip install -e .

Usage example

You can use pluxee-api as follow

import asyncio
from datetime import date, timedelta

from pluxee import PassType, PluxeeAsyncClient


async def main():
    username = input("Username: (leave empty to use PLUXEE_USERNAME env variable)")
    password = input("password: (leave empty to use PLUXEE_PASSWORD env variable)")

    pc = PluxeeAsyncClient(username, password)

    balance = await pc.get_balance()
    print(balance)
    # Will return a PluxeeBalance object with those attributes
    # lunch_pass: 89.19
    # eco_pass: 396.16
    # gift_pass: 0.0
    # conso_pass: 0.0

    transactions = await pc.get_transactions(PassType.LUNCH, date.today() - timedelta(days=60), date.today() - timedelta(days=30))
    print(transactions)
    # Will return a list of PluxeeTransaction object with those attributes
    # date: 2024-06-19
    # amount: -75.24
    # detail: Paiement classique
    # merchant: Colruyt Food Retail


if __name__ == "__main__":
    asyncio.run(main())

For asynchronous version:

import asyncio
from datetime import date, timedelta

from pluxee import PassType, PluxeeAsyncClient


async def main():
    username = input("Username: (leave empty to use PLUXEE_USERNAME env variable)")
    password = input("password: (leave empty to use PLUXEE_PASSWORD env variable)")

    pc = PluxeeAsyncClient(username, password)

    balance = await pc.get_balance()
    print(balance)
    # Will return a PluxeeBalance object with those attributes
    # lunch_pass: 89.19
    # eco_pass: 396.16
    # gift_pass: 0.0
    # conso_pass: 0.0

    transactions = await pc.get_transactions(PassType.LUNCH, date.today() - timedelta(days=60), date.today() - timedelta(days=30))
    print(transactions)
    # Will return a list of PluxeeTransaction object with those attributes
    # date: 2024-06-19
    # amount: -75.24
    # detail: Paiement classique
    # merchant: Colruyt Food Retail


if __name__ == "__main__":
    asyncio.run(main())

API Reference

pluxee: Pluxee

Classes

pluxee.base_pluxee_client.PluxeeBalance(...)

The balance of each pass.

pluxee.base_pluxee_client.PluxeeTransaction(...)

A payment or the reception of your pass.

pluxee.pluxee_client.PluxeeClient(username, ...)

A synchronous client providing information about you Pluxee balance and transactions.

pluxee.pluxee_async_client.PluxeeAsyncClient(...)

An asynchronous client providing information about you Pluxee balance and transactions.

Enums

pluxee.base_pluxee_client.PassType(value)

The different types of pass that are provided.

Functions

pluxee.pluxee_client.PluxeeClient.get_balance()

Retrieve the balance of each pass type.

pluxee.pluxee_client.PluxeeClient.get_transactions(...)

Retrieve the transactions of the requested pass type in the given interval.

pluxee.pluxee_async_client.PluxeeAsyncClient.get_balance()

Retrieve the balance of each pass type.

pluxee.pluxee_async_client.PluxeeAsyncClient.get_transactions(...)

Retrieve the transactions of the requested pass type in the given interval.

Exceptions

pluxee.exceptions.PluxeeLoginError

An error occured with the login process.

pluxee.exceptions.PluxeeAPIError

Pluxee webpage did not respond with the expected status or do not contain the expected information.

Indices and tables

Auto-generated API reference. Auto-generated module.