Skip to main content

A CLI for DJ automation workflows.

Project description

๐ŸŽง DJ Automation CLI

License: MIT Python Tests GitHub commit activity Repo Size GitHub Release Buy Me A Coffee GitHub Forks GitHub Stars

DJ Automation Banner

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. ๐Ÿš€

Buy Me A Coffee


๐Ÿ“œ Table of Contents


โœจ Features

  • 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. ๐ŸŽจ

๐Ÿ—‚๏ธ Project Structure

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

โš™๏ธ Configuration

๐Ÿ“„ .env File

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.

๐Ÿ“Œ Sample .env:

# 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=True

๐Ÿ› ๏ธ Configuration Setup

The easiest way to set up your configuration is to use the built-in setup wizard:

dj config --setup

This will guide you through:

  1. Creating necessary configuration directories
  2. Setting up default configuration files
  3. Entering your API keys
  4. Configuring paths and settings

You can also manually configure settings by editing the files in ~/Documents/DJCLI/configuration/.


๐Ÿš€ Installation

  1. Clone the Repository:

    git clone https://github.com/Katazui/DJAutomation.git
    cd DJAutomation
    
  2. Create a Virtual Environment (recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install Dependencies:

    pip install -r requirements.txt
    
  4. Install the Package:

    pip install -e .
    
  5. Run the Setup Wizard:

    python cli/main.py config --setup
    

Building the DJCLI Executable

To build a standalone executable for the DJCLI:

  1. Install PyInstaller:

    pip install pyinstaller
    
  2. Build the Executable:

    # For macOS/Linux
    pyinstaller --onefile --name dj cli/main.py
    
    # For Windows
    pyinstaller --onefile --name dj.exe cli/main.py
    
  3. Move the Executable:

    # For macOS/Linux
    mv dist/dj /usr/local/bin/
    
    # For Windows
    # Move dist/dj.exe to a directory in your PATH
    
  4. Verify Installation:

    dj --version
    
  5. 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.


๐Ÿ”ง Usage

๐Ÿ“ฅ Download Tracks

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 --organize

๐ŸŽจ Create Album Covers

Generate album covers from images:

# Normal mode
dj create_ac

# Test mode
dj create_ac --test

๐Ÿ“‚ Organize Files

Organize downloaded files:

# Organize all files
dj org_dl

# Organize only requested files
dj org_dl --requested

โ˜๏ธ Upload to Mixcloud

Upload 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-run

๐Ÿงช Run Tests

Run tests to ensure everything is working correctly:

# Run all tests
dj test

# Run specific tests
dj test --mixcloud
dj test --download

๐Ÿ“š Modules Overview

๐Ÿ” Download Module

  • downloader.py: Handles downloading audio tracks from various sources
  • download_pexel.py: Downloads images from Pexels for album covers

๐ŸŽจ Covers Module

  • create_album_cover.py: Creates album covers from downloaded images

๐Ÿ“‚ Organize Module

  • organize_files.py: Organizes downloaded files into structured directories

โ˜๏ธ Mixcloud Module

  • uploader.py: Manages uploading tracks to Mixcloud

๐Ÿ› ๏ธ Core Module

  • color_utils.py: CLI color utilities
  • file_utils.py: File handling utilities
  • metadata_utils.py: Metadata handling utilities
  • cover_utils.py: Album cover utilities

๐Ÿ”’ Security

  • API keys and sensitive credentials are stored in .env file
  • The .env file is excluded from version control
  • OAuth authentication is used for Mixcloud integration
  • HTTPS is used for all API communications

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the GitHub Issues
  2. Create a new issue if your problem isn't already reported

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Stay tuned for more features and improvements! Thank you for using DJ Automation CLI. ๐ŸŽ‰

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djautomation-1.8.1.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djautomation-1.8.1-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file djautomation-1.8.1.tar.gz.

File metadata

  • Download URL: djautomation-1.8.1.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for djautomation-1.8.1.tar.gz
Algorithm Hash digest
SHA256 c6bf146d10b62b5800f46fa816c812e48972602b84131c2297030bf95c000c53
MD5 d02b86bccb8dcd8facfffbd025a74e38
BLAKE2b-256 959d26e3f3dc04ae3c5190ba4687d3bdb6d45725c69dc930217a020b3b2e4ef5

See more details on using hashes here.

File details

Details for the file djautomation-1.8.1-py3-none-any.whl.

File metadata

  • Download URL: djautomation-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for djautomation-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8535c2d3e1ed8b750ff2e3d6f17a63af32f907799046f6e1d5768b9ab9656bd
MD5 56f61d4888d93313e65cafff37b02fb9
BLAKE2b-256 affa639e0b4e9c65468402bb029891f87b9a71f0d57198b794c55718b855dc21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page