Send summaries of eBons (Rewe, Netto, ..) to cospend.
Project description
Mail2Cospend
A workflow for publishing eBons from mail to Cospend (App in Nextcloud). Uses uv for Python project management.
Quick start
Install mail2cospend
pip install mail2cospend
Run the command
mail2cospend --help
Usage: mail2cospend [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
dry-run Dry run without publishing to the cospend server.
project-infos Only print information about the cospend project...
run Run the service.
show-config Print the current config.
Configuration with environment variables
Change them in the .env file.
Variable | Description | Type |
---|---|---|
COSPEND_PROJECT_URL | The url of the cospend project (shared link in the project) | string |
COSPEND_PROJECT_PASSWORD | The (optional) password of the cospend project (if set) | string |
COSPEND_PAYED_FOR_DEFAULT | The ids of the payed for users, seperated by a "," | string |
COSPEND_PAYED_FOR_{adapter} | The ids of the payed for users, seperated by a "," for a specified adapter (^1) | string |
COSPEND_PAYER_DEFAULT | The id of the payer | string |
COSPEND_PAYER_{adapter} | The id of the payer for a specified adapter (^1) | string |
COSPEND_CATEGORYID_DEFAULT | The id of the category | string |
COSPEND_CATEGORYID_{adapter} | The id of the category for a specified adapter (^1) | string |
COSPEND_PAYMENTMODEID_DEFAULT | The id of the payment mode | string |
COSPEND_PAYMENTMODEID_{adapter} | The id of the payment mode for a specified adapter (^1) | string |
IMAP_HOST | The IMAP host | string |
IMAP_USER | The IMAP user | string |
IMAP_PASSWORD | The IMAP password | string |
IMAP_PORT | The IMAP port | int (default: 993) |
IMAP_INBOX | 'Inbox' of of the IMAP server | string |
SINCE | 'today' or a ISO date, if 'today', then the script will use always the current day | str or ISO date |
INTERVAL | The request interval in seconds | int (default: 60) |
LOGLEVEL | The loglevel (DEBUG,INFO,WARING,ERROR) | string |
^1) Use the values of the adapter names: REWE, NETTO, PICNIC, PLANTED
Development
- Checkout this project
- Install requirements
uv sync
uv lock
Run with Python >= 3.12
uv run mail2cospend run
Use dry-run
to perform a "dry run": only request and parse bon from the mail inbox without publishing them to cospend.
If you want infos about your project (e.g., the available ids), run:
uv run mail2cospend project-infos
If you want infos about your current config, run:
uv run mail2cospend show-config
Run with Docker
./build.sh
./run.sh
Implemented adapters
- Rewe
- Netto
- Picnic
- Planted
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mail2cospend-0.3.1.tar.gz
(42.9 kB
view details)
Built Distribution
File details
Details for the file mail2cospend-0.3.1.tar.gz
.
File metadata
- Download URL: mail2cospend-0.3.1.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad9232f211fcd1bc4a9c1687951578c9d84c014908e26ac16c43a5db1a58ae0e |
|
MD5 | c66d772215eb64a9b15127baa912809a |
|
BLAKE2b-256 | 5603e7e91ed0592428cc8a7a9d04d7627ffcb622ffeddb60c20053c1ab77ac4e |
File details
Details for the file mail2cospend-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: mail2cospend-0.3.1-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4944baf16c83bfc7bb7dcfbb86144b5ca6c9ad58b220331fb6712b5b3f0ba5ab |
|
MD5 | 834f293078aade9ae091655a1bef5bbd |
|
BLAKE2b-256 | ead827b06b883920d2fb15827b3deb91757232b40ac5f41b0f55735026f73e44 |