Skip to main content

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:
  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

  1. Checkout this project
  2. 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

Project details


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.5.3.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mail2cospend-0.5.3-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file mail2cospend-0.5.3.tar.gz.

File metadata

  • Download URL: mail2cospend-0.5.3.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for mail2cospend-0.5.3.tar.gz
Algorithm Hash digest
SHA256 a5da50846db5123df59fafa7791315283e7e7b034465183a6563b5a677edd037
MD5 4c4e9958bb948c7ff5255c545975d3ad
BLAKE2b-256 135ae0a3cccff3233da869e3d55400f9690ffd0962ae08fbaceba5bb8cafb565

See more details on using hashes here.

File details

Details for the file mail2cospend-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mail2cospend-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9a3fb580e6ebc5523495decbfb56350fa4ff8617e7d958878aca806751e2ad
MD5 10fa73dec1407b18831e5b6753b5220a
BLAKE2b-256 e1113d138ea281d7d5421a300f8c959f1fd72c447d60dd92ca015d20102dfb17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page