This file provides guidance to WARP (warp.dev) when working with code in this repository.
This is a Python application that automates downloading bank statements from Česká spořitelna (CSAS) and uploading them to SharePoint. The project is set up as a MultiFlexi-compatible application with Debian packaging support.
- Main Application:
src/main.py- Currently contains a basic template that needs to be replaced with the actual CSAS-SharePoint integration logic - MultiFlexi Integration:
multiflexi/csas-sharepoint.app.json- Configuration schema for MultiFlexi framework integration - Debian Packaging:
debian/directory contains complete Debian package configuration - Testing Framework:
tests/directory set up for unit tests
The application is designed to work with:
- CSAS Banking API (requires API key, access token, account details)
- Office 365 SharePoint API (requires OAuth credentials and site configuration)
- MultiFlexi framework for application deployment and configuration
The application follows MultiFlexi configuration patterns with these environment variables:
- CSAS API credentials:
CSAS_API_KEY,CSAS_ACCESS_TOKEN,CSAS_ACCOUNT_UUID,CSAS_ACCOUNT_IBAN - SharePoint credentials:
OFFICE365_USERNAME,OFFICE365_PASSWORD,OFFICE365_CLIENTID, etc. - Debug settings:
DEBUG,APP_DEBUG,EASE_LOGGER
# Install dependencies using the current pyproject.toml setup
pip install -e .# Run main application
python3 src/main.py
# Run with MultiFlexi configuration
python3 src/main.py # Uses environment variables from MultiFlexi# Run all tests
python -m unittest discover tests
# Run specific test file
python -m unittest tests.test_module_name# Refresh CSAS access token (requires csas-statement-tools)
# This MUST be run before any CSAS API operations
make token
# The token will be written to .env file and is only valid for 5 minutes
# Always run this command immediately before testing the applicationImportant Notes:
- ČSAS access tokens have a very short 5-minute lifespan
- Always run
make tokenimmediately before any development or testing - The token is stored in the
.envfile asCSAS_ACCESS_TOKEN - If you get authentication errors, the token has likely expired - refresh it again
# Build Docker image
make buildimage
# Build multi-platform image and push
make buildx
# Run containerized application
make drun# Build Debian package
debuild -us -uc
# Clean build artifacts
debian/rules cleanAll code must follow these guidelines from the project's Copilot instructions:
- Write all code comments and messages in English
- Include docblocks for all functions and classes with purpose, parameters, and return types
- Use type hints for function parameters and return types
- Use meaningful variable names and avoid magic numbers/strings
- Always create/update unit tests when creating/updating classes
- Handle exceptions properly with meaningful error messages
- Ensure compatibility with the latest Python version
- MultiFlexi app configurations in
multiflexi/*.app.jsonmust conform to: https://raw.githubusercontent.com/VitexSoftware/php-vitexsoftware-multiflexi-core/refs/heads/main/multiflexi.app.schema.json - All produced reports must conform to: https://raw.githubusercontent.com/VitexSoftware/php-vitexsoftware-multiflexi-core/refs/heads/main/multiflexi.report.schema.json
The project uses:
- Python: pyproject.toml for Python packaging (requires Python 3.13+)
- Make: Makefile for common development tasks
- Debian: Complete debian/ packaging configuration
- Docker: Multi-platform container builds
- CI/CD: Salsa CI for Debian packaging, Dependabot for dependency updates