https://github.com/leebenson/stripe-xero-csv
Stripe transactions -> Xero-compatible .csv
https://github.com/leebenson/stripe-xero-csv
Last synced: over 1 year ago
JSON representation
Stripe transactions -> Xero-compatible .csv
- Host: GitHub
- URL: https://github.com/leebenson/stripe-xero-csv
- Owner: leebenson
- License: mit
- Created: 2018-09-14T13:35:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:56:01.000Z (over 3 years ago)
- Last Synced: 2025-03-18T16:04:07.524Z (over 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stripe -> Xero-compatible `.csv`
Python CLI for dumping Stripe transactions to a `.csv` file that's compatible with [Xero](https://xero.com) bank statement imports.
## Features
- Handles multiple currencies (just pass a `--currency` flag)
- Parses plain English/multi-lingual transaction dates using [dateparser](https://pypi.org/project/dateparser/)
- Adds Stripe fees as separate rows, for easier accounting
- Outputs to a `.csv` file that can be uploaded immediately into Xero
## Requirements
- Python 3 (tested on 3.7)
## Installation
Install packages:
```bash
pip install -r requirements.txt
```
## Usage
This is intended as a CLI tool rather than a library.
`cd` into the cloned folder and run from the command line:
```bash
python3 main.py --api-key="YOUR_STRIPE_API_HERE" --start="Jan 1" --currency="GBP"
```
By default, a `.csv` file will be generated in the the `output` folder of the current directory.
## CLI options
- `-k` or `--api-key` - Your Stripe API key (must have 'Balances' permissions)
- `-c` or `--currency` - 3 letter currency code (defaults to `USD`)
- `-s ` or `--start` - Start date (defaults to start of the current month)
- `-e` or `--end` - End date (defaults to now)
- `-o` or `--output` - Override default output file name
Dates will be parsed using [dateparser](https://pypi.org/project/dateparser/)
## LICENSE
[MIT](LICENSE)