This script interacts with the Xero API to extract invoice and payment data, as well as bank transaction details. It retrieves data, processes it, and exports it to CSV files for further analysis.
- Authenticates with the Xero API using OAuth 2.0.
- Refreshes access tokens as needed.
- Retrieves invoice details, payment details, and bank transactions.
- Exports the data to CSV files:
invoices.csv
: Contains details about invoices.payments.csv
: Contains details about payments.
refresh_token.txt
: Stores the refresh token for Xero API authentication.results_new.csv
: Contains sensitive data extracted from Xero (ensure this file is handled securely).
- Create a
.env
file with the following variables:CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret
- Install the required Python packages:
pip install -r requirements.txt
- Run the script to authenticate and retrieve data:
python main.py
This project is licensed under the MIT License. See the LICENSE
file for details.