Metadata-Version: 2.4
Name: taxformatter
Version: 0.1.1
Summary: Official Python SDK for the TaxFormatter API — parse crypto CSVs and bank statement PDFs
Project-URL: Homepage, https://taxformatter.com
Project-URL: Documentation, https://taxformatter.com/docs/api
Project-URL: Repository, https://github.com/Sean-Bravo/trw
Project-URL: Issues, https://github.com/Sean-Bravo/trw/issues
Author-email: TaxFormatter <support@taxformatter.com>
License-Expression: MIT
License-File: LICENSE
Keywords: bank-statement,crypto-tax,csv-parser,pdf-parser,taxformatter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# taxformatter

Official Python SDK for the [TaxFormatter API](https://taxformatter.com) — parse crypto exchange CSVs and bank statement PDFs programmatically.

## Install

```bash
pip install taxformatter
```

## Quick Start

```python
from taxformatter import TaxFormatter

tf = TaxFormatter("tf_live_xxx")

# Parse a file by path
result = tf.parse("./coinbase_2025.csv")

# Parse bytes with options
result = tf.parse(raw_bytes, filename="coinbase.csv", output_format="turbotax")

# List supported sources
sources = tf.list_sources()

# Check usage
usage = tf.get_usage()
```

## Configuration

```python
tf = TaxFormatter(
    "tf_live_xxx",
    base_url="https://api.taxformatter.com",  # default
    timeout=30,    # seconds, default
    max_retries=3, # auto-retry on 429, default
)
```

## Error Handling

```python
from taxformatter import TaxFormatter, AuthenticationError, RateLimitError, ParseError

try:
    result = tf.parse("./file.csv")
except AuthenticationError:
    # 401 — invalid or missing API key
    pass
except RateLimitError as e:
    # 429 — rate limited (auto-retried 3 times before raising)
    print(e.retry_after)
except ParseError as e:
    # 422 — file could not be parsed
    print(e.suggestion)
```

## API

### `tf.parse(input, filename=None, output_format=None, exchange=None, bank=None)`
Parse a crypto CSV or bank statement PDF.

- **input**: File path (`str`/`Path`) or `bytes`
- **filename**: Required when passing bytes
- **output_format**: `"koinly"`, `"turbotax"`, `"coinledger"`, or `"zenledger"`
- **exchange**: Force exchange detection (e.g., `"coinbase"`)
- **bank**: Force bank detection (e.g., `"chase"`)

### `tf.list_sources()`
List all supported crypto exchanges and banks.

### `tf.get_usage()`
Get current month's API usage.

### `tf.health()`
Check API health status.

## License

MIT
