A modern Python tool for exporting your Discogs vinyl collection to Excel or CSV, with support for QR codes, cover art, and collection statistics.
- π΅ Export Collection - Export to Excel (.xlsx) or CSV formats
- π Collection Statistics - View value, top artists, labels, and more
- π· QR Code Generation - Create QR codes for quick mobile access to releases
- πΌοΈ Cover Art Download - Download cover images for your collection
- π Web Server - Serve QR codes via HTTP for embedding in Excel
- πΎ Resume Support - Pause and resume long exports
- π Secure Credentials - API tokens stored in OS keyring (not plaintext!)
- β‘ Async/Await - Fast concurrent API requests and downloads
- π¨ Rich CLI - Beautiful progress bars and formatted output
- π§ͺ Type-Safe - Full type hints with Pydantic v2 validation
- Python 3.12 or higher
- Discogs account with API token
- Internet connection
# Clone the repository
git clone https://github.com/blackbunt/dump-discogs-collection-2-csv.git
cd dump-discogs-collection-2-csv
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in editable mode with dev dependencies
pip install -e ".[dev]"pip install discogs-dumper- Go to Discogs Developer Settings
- Click Generate new token
- Copy the token (you'll need it for authentication)
# Login with your Discogs credentials
discogs-dumper auth login
# Check authentication status
discogs-dumper auth statusYour credentials are stored securely in your system's keyring:
- macOS: Keychain
- Linux: Secret Service (GNOME Keyring, KWallet)
- Windows: Credential Manager
# Basic export to Excel
discogs-dumper export
# Export to CSV
discogs-dumper export --format csv --output my_collection.csv
# Export with QR codes and cover art
discogs-dumper export --include-qr --include-cover
# Resume an interrupted export
discogs-dumper export --resume# Show collection value and summary
discogs-dumper stats
# Show top 10 artists
discogs-dumper stats --top-artists
# Show top 5 labels
discogs-dumper stats --top-labels --top-n 5
# Show everything
discogs-dumper stats --top-artists --top-labels# Generate QR codes for all releases
discogs-dumper qr generate
# Generate to custom directory
discogs-dumper qr generate --output-dir my-qr-codes/
# Overwrite existing QR codes
discogs-dumper qr generate --overwrite# Download cover art for all releases
discogs-dumper cover download
# Download to custom directory
discogs-dumper cover download --output-dir my-covers/
# Overwrite existing covers
discogs-dumper cover download --overwrite# Start server on default port (1224)
discogs-dumper server start
# Start on custom port
discogs-dumper server start --port 8080
# Serve from custom directory
discogs-dumper server start --directory custom-qr/The web server allows you to embed QR codes in Excel files using URLs like:
http://localhost:1224/123456_Artist_Name-Album_Title.png
# Verbose output (show DEBUG/INFO logs)
discogs-dumper --verbose export
# Quiet mode (only errors)
discogs-dumper --quiet export
# Write logs to file
discogs-dumper --log-file debug.log export.
βββ discogs_collection.xlsx # Export file
βββ qr/ # QR codes (if generated)
β βββ 123456_Artist-Album.png
β βββ ...
βββ Cover-Art/ # Cover images (if downloaded)
β βββ 123456_Artist-Album.jpg
β βββ ...
βββ .discogs-dumper/ # Application state
βββ progress.json # Resume progress
The tool uses sensible defaults, but you can customize via environment variables:
# API settings
export DISCOGS_API_BASE_URL=https://api.discogs.com
export DISCOGS_API_RATE_LIMIT_CALLS=60
export DISCOGS_API_PER_PAGE=100
# Output settings
export DISCOGS_QR_OUTPUT_DIR=qr
export DISCOGS_COVER_OUTPUT_DIR=Cover-Art
export DISCOGS_DEFAULT_EXPORT_FORMAT=excel
# Server settings
export DISCOGS_WEBSERVER_PORT=1224
export DISCOGS_WEBSERVER_HOST=localhost
# Concurrency
export DISCOGS_MAX_CONCURRENT_DOWNLOADS=10
export DISCOGS_MAX_CONCURRENT_API_PAGES=5Or create a .env file in your project directory.
The project follows modern Python best practices:
- src-layout structure for proper packaging
- Async/await throughout for performance
- Pydantic v2 for data validation
- Click for CLI framework
- aiohttp for async HTTP requests
- Rich for beautiful terminal output
- pytest with async support
- ruff for linting and formatting
- mypy for static type checking
- pre-commit hooks for code quality
src/discogs_dumper/
βββ api/ # Discogs API client (async)
β βββ client.py # Main API client
β βββ models.py # Pydantic data models
β βββ rate_limiter.py
β βββ exceptions.py
βββ cli/ # Click CLI commands
β βββ main.py # CLI entry point
β βββ commands/ # Individual commands
βββ core/ # Business logic
β βββ collection.py # Collection fetching
β βββ exporter.py # Excel/CSV export
β βββ qr_generator.py # QR code generation
β βββ cover_downloader.py
β βββ statistics.py
β βββ webserver.py
βββ persistence/ # State & credentials
β βββ credentials.py # Keyring integration
β βββ state.py # Progress tracking
β βββ models.py
βββ utils/ # Utilities
β βββ sanitization.py
β βββ logging.py
βββ config/ # Configuration
βββ settings.py # Pydantic settings
βββ defaults.py # Constants
# Run all tests
pytest
# Run with coverage
pytest --cov=discogs_dumper --cov-report=html
# Run specific test file
pytest tests/unit/test_sanitization.py -v
# Run with verbose logging
pytest --log-cli-level=DEBUG# Format code
ruff format .
# Lint code
ruff check .
# Type check
mypy src/
# Run all checks (via pre-commit)
pre-commit run --all-filespre-commit install# Remove stored credentials
discogs-dumper auth logout
# Login again
discogs-dumper auth loginThe Discogs API allows 60 requests/minute for authenticated users. The tool automatically handles rate limiting, but very large collections may take time to export.
If an export is interrupted:
# Resume from where it left off
discogs-dumper export --resumeProgress is saved every 50 items or 30 seconds.
Version 2.0 is a complete rewrite with breaking changes:
- CLI Interface: Interactive menu β Click commands
- Credentials:
config.yamlβ OS Keyring (secure!) - Command:
python main.pyβdiscogs-dumper - Python Version: 3.8+ β 3.12+
-
Install v2.0:
pip install -e . -
Re-authenticate (credentials will be migrated):
discogs-dumper auth login
-
Your old
config/config.yamlcan be safely deleted after migration.
- β Export format (Excel/CSV) is identical
- β QR codes are generated the same way
- β Web server uses the same port (1224)
- β Output files have the same structure
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Make sure to:
- Run tests (
pytest) - Format code (
ruff format) - Type check (
mypy src/) - Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Discogs for the excellent API
- Click for the CLI framework
- Rich for beautiful terminal output
- Pydantic for data validation
- GitHub: @blackbunt
- Repository: dump-discogs-collection-2-csv
Made with β€οΈ by Bernie