Metadata-Version: 2.5
Name: tricount-extractor
Version: 0.2.1
Summary: Extract and save Tricount registries to Excel files
Project-URL: Repository, https://github.com/wenceslas-sanchez/tricount-extractor
Project-URL: Changelog, https://github.com/wenceslas-sanchez/tricount-extractor/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/wenceslas-sanchez/tricount-extractor/issues
Author: Wenceslas Sanchez
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: excel,expenses,export,splitwise,tricount
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.12
Requires-Dist: cryptography>=50.0.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: numpy>=2.5.2
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: pandas>=3.0.4
Description-Content-Type: text/markdown

# tricount-extractor

Extract and save Tricount registries to Excel files.

## Installation

```bash
pip install tricount-extractor
```

Or run it without installing, using [uv](https://docs.astral.sh/uv/):

```bash
uvx tricount-extractor -id <registry-id> -f <output-folder>
```

## Development setup

Install dependencies using uv:

```bash
git clone https://github.com/wenceslas-sanchez/tricount-extractor.git
cd tricount-extractor
uv sync --all-groups
```

## Usage

Extract one or more Tricount registries:

```bash
uv run tricount-extractor -id <registry-id> [<registry-id> ...] -f <output-folder>
```

Example:

```bash
uv run tricount-extractor -id abc123 xyz789 -f ./output
```

## Output Format

Each registry is saved as an Excel file with 6 sheets:

### 1. members
Registry participants with their details.

| Column | Description |
|--------|-------------|
| member_id | Unique member identifier |
| member_uuid | Member UUID |
| member_name | Display name |
| status | Membership status (ACTIVE, etc.) |

### 2. entries
All expense entries in the registry.

| Column | Description |
|--------|-------------|
| entry_id | Unique entry identifier |
| date | Entry date and time |
| description | Expense description |
| amount | Total amount paid |
| currency | Currency code (USD, EUR, etc.) |
| original_amount | Amount paid in the original currency |
| original_currency | Original currency code if different from registry currency |
| payer | Name of person who paid |
| is_reimbursement | True if this is a reimbursement |
| is_income | True if this is an income (money received by the group) |
| category | Expense category (FOOD, ACCOMMODATION, etc.) |

### 3. allocations
How each expense is split among participants.

| Column | Description |
|--------|-------------|
| entry_id | Reference to the expense entry |
| date | Entry date and time |
| description | Expense description |
| payer | Name of person who paid |
| is_reimbursement | True if this is a reimbursement |
| is_income | True if this is an income (money received by the group) |
| participant | Name of person this allocation applies to |
| share | Amount allocated to this participant |
| currency | Currency code |
| original_share | Share amount in the original currency |
| original_currency | Original currency code if different from registry currency |

### 4. attachments
Image URLs attached to expense entries.

| Column | Description |
|--------|-------------|
| entry_id | Reference to the expense entry |
| url | URL of the attached image |

### 5. balances
Final balance for each member (who owes/is owed).

| Column | Description |
|--------|-------------|
| member | Member name |
| balance | Net balance (positive = owed, negative = owes) |

### 6. transaction_ledger
Detailed view of each transaction showing each member's net position per entry and signed amount depending on the entry type.

| Column | Description |
|--------|-------------|
| date | Entry date |
| description | Expense description |
| category | Expense category |
| type | Transaction type label |
| cost | Total cost (0 for reimbursements) |
| currency | Currency code |
| [Member names] | Each member has a column showing their net balance for this entry (amount owed minus amount paid) |

## Development

Run tests:

```bash
uv run --all-groups pytest
```
