Skip to main content

ishelf-ee — InvoiceShelf Expense Exporter

Export a client's expenses from a self-hosted InvoiceShelf (2.4.1) instance to CSV, and bundle their receipts into a zip. Zero runtime dependencies (Python standard library only). Installs the ee command.

Install

pip install ishelf-ee

Requires Python 3.8+. Or run from a clone without installing:

python3 -m ishelf_ee --client "Acme Corp" --start 01042025 --end 30062025
# or the legacy shim:
python3 export_expenses.py --client "Acme Corp" --start 01042025 --end 30062025

Configure

The tool needs your instance URL and login. Provide them either as environment variables or in a config file. Never commit or share your filled-in config — it holds your password.

Required: INVOICESHELF_URL, INVOICESHELF_EMAIL, INVOICESHELF_PASSWORD. Optional: INVOICESHELF_COMPANY_ID (default 1; or use --company), INVOICESHELF_USER_AGENT (see Troubleshooting).

Option A — environment variables (work from any directory)

export INVOICESHELF_URL=https://invoices.example.com
export INVOICESHELF_EMAIL=you@example.com
export INVOICESHELF_PASSWORD=your-password

Option B — a config file

Copy the template and fill it in:

mkdir -p ~/.config/ishelf-ee
curl -o ~/.config/ishelf-ee/config.env \
  https://raw.githubusercontent.com/<you>/ishelf-ee/main/config.env.example
# then edit ~/.config/ishelf-ee/config.env

The config file is discovered in this order (first match wins):

  1. --config PATH (explicit)
  2. $INVOICESHELF_CONFIG
  3. ./config.env (current directory)
  4. ~/.config/ishelf-ee/config.env ← recommended for the installed ee command
  5. ~/.ishelf-ee.env

Environment variables always override file values.

Usage

ee --client "Acme Corp" --start 01042025 --end 30062025
ee --company "My Company" --client "Acme Corp" --start 01042025 --end 30062025
ee --customer-id 12 --start 01042025 --end 30062025 --out ./exports
ee --client "Acme Corp" --start 01042025 --end 30062025 --dry-run

Dates are DDMMYYYY, inclusive. Outputs <Client>_<start>-<end>.csv and <Client>_<start>-<end>_receipts.zip into --out (default exports/). Use --dry-run to see what would be exported without downloading or writing anything.

Choosing the company

If you run more than one company in InvoiceShelf, pass --company "Name" to scope the export; the name is resolved to its id (case-insensitive, exact match preferred). --company overrides INVOICESHELF_COMPANY_ID. On an ambiguous or unknown name, the tool lists the available companies as id — name so you can pick.

Troubleshooting

Cloudflare "Error 1010: Access denied" / HTTP 403 on login. The instance is behind Cloudflare, which bans the default Python User-Agent. The tool already sends a browser User-Agent. If your Cloudflare config still blocks it, override it:

INVOICESHELF_USER_AGENT="Mozilla/5.0 (...)" ee ...

If it persists, allowlist your own access in the Cloudflare dashboard (e.g. a WAF skip rule for the /api/* path, or turn off Bot Fight Mode for the API) — it is your own site.

Develop / test

python3 -m unittest discover -s tests -v

Releasing

Publishing to PyPI is automated via GitHub Actions (.github/workflows/publish-to-pypi.yaml) using PyPI Trusted Publishing — no API token is stored. To cut a release:

  1. Bump version in pyproject.toml (must match the tag below).

  2. Commit, then tag and push:

     git tag v0.1.0
     git push origin main --tags
    

The workflow builds and publishes the tagged version. A one-time Trusted Publisher must be configured on PyPI for the ishelf-ee project (owner argoyal, repo ishelf-ee, workflow publish-to-pypi.yaml).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ishelf_ee-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

ishelf_ee-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file ishelf_ee-0.1.0.tar.gz.

File metadata

  • Download URL: ishelf_ee-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ishelf_ee-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00547c167c54914981e8411e0ceefd6f80bbcc53dd98c7a41ba3df5a5bc649cc
MD5 ffb4d9254b6f542fbee7df236011695c
BLAKE2b-256 295e484baf977010ef8af4b6afc255eb49ebf25b31612aa23191382b21169721

See more details on using hashes here.

Provenance

The following attestation bundles were made for ishelf_ee-0.1.0.tar.gz:

Publisher: publish-to-pypi.yaml on argoyal/ishelf-ee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ishelf_ee-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ishelf_ee-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ishelf_ee-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab202daa93e10c3908cb72e1955e4d59ff3491c9b55a6cb1306fb58beda81fd
MD5 469a271fd627a9c3fd32d108af4621f9
BLAKE2b-256 e27ae8ec4f1dc141d73e4b9a9fc1c426fdf53bd93ab00945ca414db1dff28973

See more details on using hashes here.

Provenance

The following attestation bundles were made for ishelf_ee-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on argoyal/ishelf-ee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.0

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page