Welcome to the DJ Automation CLI! This powerful tool streamlines your DJ workflow by automating tasks such as downloading tracks, organizing files, generating album covers, and uploading mixes to Mixcloud. Whether you're managing a personal collection or handling large-scale uploads, this CLI has got you covered. π
- π§ DJ Automation CLI
- Automated Downloads: Fetch audio tracks from various sources effortlessly.
- File Organization: Automatically organize your downloads for easy access.
- Album Cover Generation: Create stunning album covers for your mixes.
- Mixcloud Integration: Seamlessly upload your mixes to Mixcloud with OAuth authentication.
- Scheduling: Schedule uploads to publish your mixes at optimal times.
- Robust Testing: Ensure reliability with comprehensive automated tests.
- Colorful CLI: Enjoy an intuitive and visually appealing command-line interface with color-coded messages. π¨
DJAutomation/
β
βββ cli/
β βββ main.py # Main CLI entry point
β βββ mixcloud_cli.py # Mixcloud-specific CLI functions
β βββ test_cli.py # CLI for running tests
β βββ download_cli.py # Download-specific CLI functions
β βββ organize_cli.py # Organization-specific CLI functions
β
βββ config/
β βββ settings.py # Main configuration settings
β βββ default_settings.py # Default configuration template
β βββ default_albumCoverConfig.json # Default album cover settings
β βββ albumCoverConfig.json # User album cover settings
β
βββ core/
β βββ color_utils.py # Utilities for colored CLI messages
β βββ file_utils.py # File handling utilities
β βββ metadata_utils.py # Metadata handling utilities
β βββ cover_utils.py # Album cover utilities
β
βββ modules/
β βββ download/
β β βββ downloader.py # Module for downloading tracks
β β βββ download_pexel.py # Module for downloading images
β β
β βββ covers/
β β βββ create_album_cover.py # Module for creating album covers
β β
β βββ organize/
β β βββ organize_files.py # Module for organizing files
β β
β βββ mixcloud/
β βββ uploader.py # Module for uploading to Mixcloud
β
βββ tests/
β βββ test_mixcloud.py # Tests for Mixcloud uploader
β
βββ .env # Environment variables (not committed)
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup file
βββ README.md # Project documentation
All sensitive credentials and environment-specific settings are managed through the .env file. Ensure this file is listed in your .gitignore to prevent accidental commits of sensitive information.
# Mixcloud OAuth
MIXCLOUD_CLIENT_ID=""
MIXCLOUD_CLIENT_SECRET=""
# Spotify
SPOTIFY_CLIENT_ID=""
SPOTIFY_CLIENT_SECRET=""
# Last.fm
LASTFM_API_KEY=""
# Deezer
DEEZER_API_KEY=""
# MusicBrainz
MUSICBRAINZ_API_TOKEN=""
# Pexel
PEXEL_API_KEY=""
# General Settings
DEBUG_MODE=False
USE_COLOR_LOGS=TrueThe easiest way to set up your configuration is to use the built-in setup wizard:
dj config --setupThis will guide you through:
- Creating necessary configuration directories
- Setting up default configuration files
- Entering your API keys
- Configuring paths and settings
You can also manually configure settings by editing the files in ~/Documents/DJCLI/configuration/.
-
Clone the Repository:
git clone https://github.com/Katazui/DJAutomation.git cd DJAutomation -
Create a Virtual Environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Install the Package:
pip install -e . -
Run the Setup Wizard:
python cli/main.py config --setup
To build a standalone executable for the DJCLI:
-
Install PyInstaller:
pip install pyinstaller
-
Build the Executable:
# For macOS/Linux pyinstaller --onefile --name dj cli/main.py # For Windows pyinstaller --onefile --name dj.exe cli/main.py
-
Move the Executable:
# For macOS/Linux mv dist/dj /usr/local/bin/ # For Windows # Move dist/dj.exe to a directory in your PATH
-
Verify Installation:
dj --version
-
Configure the Executable:
dj config --setup
Note: The executable will be created in the dist directory. Make sure to move it to a location in your system's PATH for easy access.
Download tracks from YouTube/SoundCloud links:
# Interactive mode
dj dl_audio
# File mode (reads from musicLinks.txt)
dj dl_audio --mode file
# Download and organize
dj dl_audio --organizeGenerate album covers from images:
# Normal mode
dj create_ac
# Test mode
dj create_ac --testOrganize downloaded files:
# Organize all files
dj org_dl
# Organize only requested files
dj org_dl --requestedUpload mixes to Mixcloud:
# Initialize Mixcloud settings
dj up_mixes --init-settings
# Upload mixes
dj up_mixes
# Dry run (no actual upload)
dj up_mixes --dry-runRun tests to ensure everything is working correctly:
# Run all tests
dj test
# Run specific tests
dj test --mixcloud
dj test --download- downloader.py: Handles downloading audio tracks from various sources
- download_pexel.py: Downloads images from Pexels for album covers
- create_album_cover.py: Creates album covers from downloaded images
- organize_files.py: Organizes downloaded files into structured directories
- uploader.py: Manages uploading tracks to Mixcloud
- color_utils.py: CLI color utilities
- file_utils.py: File handling utilities
- metadata_utils.py: Metadata handling utilities
- cover_utils.py: Album cover utilities
- API keys and sensitive credentials are stored in
.envfile - The
.envfile is excluded from version control - OAuth authentication is used for Mixcloud integration
- HTTPS is used for all API communications
If you encounter any issues or have questions:
- Check the GitHub Issues
- Create a new issue if your problem isn't already reported
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Stay tuned for more features and improvements! Thank you for using DJ Automation CLI. π

