Skip to main content

Firefly Cash Converter

A Python tool for converting financial transaction data from various sources (Barclays, PayPal, Trade Republic, etc.) and transferring them to Firefly III personal finance manager.

Prerequisites

  • Python >= 3.11
  • A running Firefly III instance (for the transfer command)

Installation

Install directly from the GitHub repository:

pip install git+https://github.com/phdorp/gnucash-convert.git@main

or from PyPI

pip install firefly-cash-converter

This will install the cash command-line tool for converting and transferring financial transactions.

Configuration

For the transfer command, you need a config.toml file with your Firefly III instance details. Create one based on this template:

[firefly_interface]
base_url = "http://your-firefly-instance"
api_token = "your-api-token-here"
duplicate_transaction = "ignore"  # options: "error", "ignore"

See the examples/config.toml file for reference.

Usage

The tool provides two main commands: convert and transfer.

Supported Sources

Source Convert Transfer
barclays ✓ ✓
paypal ✓ ✓
trade_republic ✓ ✓
common ✗ ✓

Convert

The convert command converts transaction data from various sources to a common CSV format compatible with Firefly III:

cash convert <source> <input_file> [options]

Options:

  • source: Source format (choices: barclays, paypal, trade_republic)
  • input_file: Path to the input file to be converted (without file extension)
  • --output: Output directory (default: current directory)
  • --file_name: Output file name without extension (default: transactions)
  • --account_name: Name of the account to assign to transactions
  • --filter_query: Optional pandas query to filter transactions (see Filter Queries)

Example:

Change directory to the examples directory. The following command transforms the transactions stored in tmp/trade_republic.csv to the common Firefly representation. Only transactions after the date 2025-07-01 are converted.

cash convert trade_republic tmp/trade_republic --account_name "My Trading Account" --filter_query "date >= '2025-07-01'"

Transfer

The transfer command loads transaction data and directly transfers it to your Firefly III instance via API:

cash transfer <source> [options]

Options:

  • source: Source format (choices: barclays, paypal, trade_republic, common)
  • --config_path: Path to configuration file (default: ./config.toml)
  • --account_name: Name of the account to assign to transactions
  • --input_directory: Directory containing input files (default: tmp)
  • --input_name: Name of the input file (defaults to source name)
  • --filter_query: Optional pandas query to filter transactions (see Filter Queries)
  • --apply_rule_groups: List of rule group titles to apply after transferring transactions.

Example with manual file:

Change directory to the examples directory and launch your Firefly server. Adapt the file config.toml to your needs. The following command transfers transactions after the date 2025-07-01 to your Firefly server:

cash transfer trade_republic --account_name "My Trading Account" --filter_query "date >= '2025-07-01'"

Example with Pytr (Trade Republic):

If you own a Trade Republic account, you can download your transaction data with the pytr package:

pip install pytr

The following command enables an almost automated transfer of your transaction data (2FA code must be entered manually):

pytr export_transactions tmp/trade_republic.csv --store_credentials --format csv
cash transfer trade_republic --account_name "My Trading Account"

Filter Queries

The --filter_query option accepts pandas query expressions for filtering transactions. Common examples:

  • Filter by date: "date >= '2025-07-01'"
  • Date range: "date >= '2025-01-01' and date <= '2025-12-31'"
  • Amount filters: "amount > 100" or "amount < 0" (negative for expenses)
  • Combine conditions: "date >= '2025-01-01' and amount > 50"

For more complex queries, refer to the pandas query documentation.

Tests

The tests of the firefly interface rely on a local Firefly III server.

1. Start the Test Server

Launch the Firefly III server using Docker Compose:

cd ./test/fireflyServer
sudo docker compose up

Wait for the server to be ready (this may take a minute on first run).

2. Create an API Token

Run the token creation script:

bash test/fireflyServer/createToken.sh

This script initializes Laravel Passport, creates a test user with owner permissions (user_role_id = 21), generates a personal access token, and saves it to the .env file.

3. Run Tests

Once the test server is running and the API token is configured in the .env file, install the package with dev dependencies and run the tests:

# Install package with dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest --cov=fireflyConverter test/

Note: The .env file is automatically loaded by the test suite using python-dotenv (included in dev dependencies).

Metadata

Release files for firefly-cash-converter 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firefly-cash-converter 0.2.1
File Size Uploaded
firefly_cash_converter-0.2.1.tar.gz 27.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for firefly-cash-converter 0.2.1
File Interpreter ABI Platform
firefly_cash_converter-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 56.3 kB

Release files / firefly_cash_converter-0.2.1.tar.gz

Download URL firefly_cash_converter-0.2.1.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9dff262f5256cb0d7f96ea39a301ca273dac95491054e015cc0651f41b82bdad
BLAKE2b-256 checksum
How to use checksums
7a1c0ac46996b8183ed821f11fd68078b40859da1708570418193a06c150c866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release files / firefly_cash_converter-0.2.1-py3-none-any.whl

Download URL firefly_cash_converter-0.2.1-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7bb030b9baf9e691ff6ffc978c0c765dc9861b6ea9700046e5139bea6147fb8
BLAKE2b-256 checksum
How to use checksums
575714153c507553413464e1f8932e83de17417de42196949364f85a1635c9ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release 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