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

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


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

Uploaded Source

Built Distribution

mail2cospend-0.3.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mail2cospend-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cc18aace7c70749861e2ca016bcdda80f7fb17cd28a539df02c3d8aacf9a78fa
MD5 434ea3bc2bf08925ed82954d8072eadf
BLAKE2b-256 ddc75af87821c2b431f4f2ba8b91787915e1500d217dfd3d5cc23ab362f7f79b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mail2cospend-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1c2cf30fd33d73388925300af4a75c1c22d1b0237ee22b7b8e47d1c8ef8340d
MD5 58d5acf399765a3bd70de5313cf812c6
BLAKE2b-256 a3e8194c149ccd0912c0984a923100a720c35bc4903d9f2b28bf4efafcffd98a

See more details on using hashes here.

Supported by

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