desjardins-py
Disclaimer: This project is not affiliated with, endorsed by, or in any way connected to Desjardins Group. It is an independent, unofficial tool that interacts with Desjardins' web interface through browser automation. Use at your own risk. Your credentials are never transmitted anywhere other than Desjardins' own servers.
Personal use only. This project is intended solely for personal, non-commercial use. You may not redistribute, sublicense, or use it as part of a product or service.
Unofficial Desjardins AccèsD wrapper for Python. Track your balance, credit cards, transactions, and statements. Pipe the data anywhere you need it.
Features
- Fetch accounts, credit cards, transactions, and statement metadata from AccèsD
- Returns typed Pydantic models — work with your data directly in Python
- Persist to SQLite, MySQL, or PostgreSQL with a single
save()call - Incremental fetching — only imports transactions newer than the last run
- Export to CSV or XLSX with
to_csv()/to_excel() - Persistent browser session — saves the session after the first OTP verification so subsequent runs are unattended
How it works
- Opens a headless Chromium browser to log into your AccèsD account and obtain a valid session token
- Intercepts the accounts API response to collect
BankAccountandCreditCardrecords - Calls the Desjardins REST API directly (reusing the session token) to fetch transactions and statement metadata for each account
- Returns a typed
FetchResultcontaining all fetched data. Use it directly in your code or persist it to a database
Usage
Once fetched, your data is plain Python objects — use them however you like:
- Budget automation — categorize transactions and trigger alerts when spending thresholds are hit
- Power BI / Tableau — load into a database and connect a live report on top of it
- Excel / Google Sheets — export with
to_excel()orto_csv()and refresh your spreadsheet on a schedule - Custom dashboards — pipe into any Python data stack (pandas, Plotly, Streamlit, etc.)
- Notifications — send a daily summary to Slack, email, or a home automation system
Installation
With pip
pip install desjardins-py
playwright install chromium
With uv
uv sync
uv run playwright install chromium
Examples
Basic fetch and inspect data
No database required. Credentials are passed directly.
from desjardins_py import DesjardinsClient
client = DesjardinsClient(
card_number="your_card_number",
password="your_password",
)
result = client.fetch()
# result.accounts → list[BankAccount]
# result.cards → list[CreditCard]
# result.transactions → list[Transaction]
# result.card_transactions → list[CardTransaction]
# result.statements → list[Statement]
for account in result.accounts:
print(account.name, account.amount, account.currency)
for tx in result.transactions:
print(tx.effective_date, tx.description, tx.amount)
On the first run you will be prompted for an OTP verification code in the terminal. Subsequent runs reuse the saved session in .session/.
Persist to SQLite
from desjardins_py import DesjardinsClient
client = DesjardinsClient(
card_number="your_card_number",
password="your_password",
)
client.connect_db("sqlite:///accesd.db")
result = client.fetch()
result.save() # inserts only transactions newer than the last fetch
Persist to PostgreSQL
pip install desjardins-py[postgres] # or: uv sync --extra postgres
from desjardins_py import DesjardinsClient
client = DesjardinsClient(
card_number="your_card_number",
password="your_password",
)
client.connect_db("postgresql+psycopg2://user:password@localhost:5432/accesd")
result = client.fetch()
result.save()
For MySQL:
pip install desjardins-py[mysql]and usemysql+pymysql://user:password@localhost:3306/accesd.
Export to XLSX
from desjardins_py import DesjardinsClient
client = DesjardinsClient(
card_number="your_card_number",
password="your_password",
)
result = client.fetch()
result.to_excel("accesd.xlsx") # one sheet per table
result.to_csv("./export") # one CSV file per table
OTP
When you log in for the first time (or after your saved session expires), Desjardins sends a one-time security code by SMS. By default, desjardins-py pauses and waits for you to type it in the terminal:
OTP code: ██████
Once entered, the session is saved to your profile_dir (default ./.session) and subsequent runs are fully unattended.
Automatic OTP with OTPCatcher
On macOS, you can have the library read the SMS code from the Messages app automatically by passing catch_otp=True:
client = DesjardinsClient(
card_number="your_card_number",
password="your_password",
catch_otp=True,
)
Requirements:
- macOS only — OTPCatcher reads from
~/Library/Messages/chat.db, which only exists on macOS. - iMessage / SMS sync enabled — your iPhone must be set up to forward SMS messages to your Mac via Settings → Messages → Text Message Forwarding.
- Full Disk Access — the process running the script (Terminal, iTerm2, your IDE, or the Python interpreter) must be granted Full Disk Access under System Settings → Privacy & Security → Full Disk Access. Without it, the database read will fail with a
PermissionError.
OTPCatcher polls the Messages database for up to 10 attempts (10-second intervals) and looks for any SMS containing "Votre code de sécurité AccèsD est" received within the last 30 seconds.
DesjardinsClient parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
card_number |
str |
— | Your AccèsD card number |
password |
str |
— | Your AccèsD password |
verbose |
bool |
True |
Print INFO-level logs to stdout |
profile_dir |
str |
'./.session' |
Directory used to persist the browser session across runs |
catch_otp |
bool |
False |
Automatically read the OTP from the macOS Messages app (see OTP) |
Database schema
| Table | Description |
|---|---|
bank_accounts |
Chequing / savings accounts |
credit_cards |
Credit cards and lines of credit |
transactions |
Bank account transaction history |
card_transactions |
Credit card transaction history |
statements |
Statement metadata (name, date, size) |
Metadata
Release files for desjardins-py 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| desjardins_py-0.1.1.tar.gz | 87.3 kB | With provenance | Details for desjardins_py-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| desjardins_py-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for desjardins_py-0.1.1-py3-none-any.whl |
Total release size: 102.0 kB
Release files / desjardins_py-0.1.1.tar.gz
| Download URL | desjardins_py-0.1.1.tar.gz |
|---|---|
| Size | 87.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45b3e9eb14a49759c403b49b00fc9ffdcde1bf49f41dfafe221c040f2d504537
|
|
BLAKE2b-256 checksum How to use checksums |
b1d723f449e832e849a54f16f7bb4bc2b6fefc22817bcfb9e69c884eb5bd38c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 20, 2026.
Transparency logRelease files / desjardins_py-0.1.1-py3-none-any.whl
| Download URL | desjardins_py-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6412057493898ae6ca8a3ac297f506040f5c0f9479794665f8d40afbd8d9b0eb
|
|
BLAKE2b-256 checksum How to use checksums |
931d8e177d3191a4640e0967cbbd0a2ea099f8eac8bf8925fdd5f6d2093e4cbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 20, 2026.
Transparency logSecurity for desjardins-py 0.1.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for desjardins_py-0.1.1.tar.gz
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 Jun 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.