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:
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 |
| ADAPTER_{adapter}_ENABLED | Enable or diable the specified adapter (^1), default is TRUE | boolean |
| NTFY_URL | The url of the ntfy server. If not set it is disabled. | string |
| NTFY_BEARER_AUTH_TOKEN | The (optional) bearer auth token for the ntfy server. | string |
| NTFY_TOPIC | The topic for the ntfy notifications. | string |
| NTFY_MESSAGE_TEMPLATE | The message template for the ntfy notifications. Use the {adapter}/{document}/{timestamp}/{sum} variables in this template. | 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, EDEKA, IKEA
Development
- Checkout this project
- Install requirements
uv sync
uv lock
Run with Python >= 3.12
uv run mail2cospend run
Use --dry 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
- Kokku
- Planted (no online shop anymore :( )
- Edeka
- Ikea
Metadata
Release files for mail2cospend 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mail2cospend-0.5.3.tar.gz | 45.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mail2cospend-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.7 kB
Release files / mail2cospend-0.5.3.tar.gz
| Download URL | mail2cospend-0.5.3.tar.gz |
|---|---|
| Size | 45.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5da50846db5123df59fafa7791315283e7e7b034465183a6563b5a677edd037
|
|
BLAKE2b-256 checksum How to use checksums |
135ae0a3cccff3233da869e3d55400f9690ffd0962ae08fbaceba5bb8cafb565
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.2
|
Release files / mail2cospend-0.5.3-py3-none-any.whl
| Download URL | mail2cospend-0.5.3-py3-none-any.whl |
|---|---|
| Size | 42.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e9a3fb580e6ebc5523495decbfb56350fa4ff8617e7d958878aca806751e2ad
|
|
BLAKE2b-256 checksum How to use checksums |
e1113d138ea281d7d5421a300f8c959f1fd72c447d60dd92ca015d20102dfb17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.2
|