Free yourself from the tyranny and limitations of ERG wallets! This little tool will fetch your ERG address details from explorer API, and export them to Koinly CSV format. Can be easily modified for any other format as well.
- ✅ Fetches transactions from Ergo Platform API
- ✅ Processes both regular ERG transactions and token transactions
- ✅ Handles wallet consolidation transactions
- ✅ Exports data to CSV files compatible with tax software (Koinly format)
- ✅ Robust error handling with automatic retries
- ✅ Progress tracking for large datasets
- ✅ Address validation
- ✅ Comprehensive test coverage
- Python 3.12 or higher
- Poetry (for dependency management)
-
Install Poetry if you haven't already:
pip install poetry
-
Install project dependencies:
poetry install
If you prefer using pip, you can install dependencies from requirements.txt:
pip install -r requirements.txt-
Configure your wallet addresses:
- Copy
sample_dotenvto.env - Edit
.envand set environment variable names with comma-separated wallet addresses - For best results, include all addresses your wallet uses (to track internal transfers correctly)
- Copy
-
Run the exporter:
# Using Poetry poetry run python export_all.py # Or without Poetry python3 export_all.py
-
View the output:
- Transaction CSV files will be created in the current directory
- Regular transactions:
{wallet_name}.csv - Token transactions:
{wallet_name}_tokens.csv
The project includes comprehensive test coverage for validation, formatting, and transaction processing.
poetry run pytestpoetry run pytest -vpoetry run pytest --cov=. --cov-report=term-missingpoetry run pytest --cov=. --cov-report=html
# Open htmlcov/index.html in your browserexport-erg-transactions/
├── export_all.py # Main script
├── pyproject.toml # Poetry configuration and dependencies
├── requirements.txt # Pip dependencies (legacy)
├── .env # Your wallet configuration (create from sample_dotenv)
├── sample_dotenv # Example configuration file
├── tests/ # Test suite
│ ├── test_validation.py # Address validation tests
│ ├── test_formatting.py # Formatting and CSV tests
│ ├── test_transaction_processing.py # Transaction processing tests
│ └── test_token_processing.py # Token processing tests
└── README.md # This file
# Add a runtime dependency
poetry add package-name
# Add a development dependency
poetry add --group dev package-nameThe codebase follows best practices:
- Type hints for all functions
- Comprehensive docstrings
- Modular design with helper functions
- Constants for magic numbers
- Robust error handling
- Input validation
15.10.2025: Major refactoring and improvements
- Converted to Poetry for dependency management
- Added comprehensive test suite (44 tests, 100% pass rate)
- Refactored token processing with helper functions
- Added type hints throughout
- Improved code organization and maintainability
- Added validation for asset decimals
- Centralized CSV schema management
13.10.2025: Refactor and cleanup
- Updated libraries
- Added progress meter for larger amounts of transactions
Initial Release: Basic functionality
- Transaction fetching from Ergo Platform API
- CSV export in Koinly format
MIT
Contributions are welcome! Please ensure:
- All tests pass:
poetry run pytest - Code follows existing style and conventions
- New features include appropriate tests