This tool is designed EXCLUSIVELY for development and testing environments.
- β Development databases
- β Testing databases
- β Staging/QA databases (with extreme caution)
- β Local test instances
- β Generating fake/test data
- β Production databases
- β Live customer data
- β Any database containing real user information
- β Databases without complete backups
- β Any system where data integrity is critical
- π₯ Corrupt your database
- π₯ Destroy real information permanently
- π₯ Replace genuine data with random test data
- π₯ Make data recovery impossible without backups
IF YOU ARE NOT 100% CERTAIN THIS IS A TEST DATABASE, DO NOT PROCEED!
The Database Development Assistant (DDA) is a comprehensive Python-based toolkit designed to streamline MySQL database development, testing, and data management. Built with developers and database administrators in mind, DDA provides intelligent tools for generating realistic test data, validating database schemas, and performing common development tasks efficiently and safely in non-production environments.
- Smart Database Discovery: Automatically detects tables with gender and name columns
- Categorized Names Database: 100+ names across multiple ethnic/regional groups (English, Arabic, Asian, African)
- Flexible Configuration: Update single or multiple name columns based on gender
- Safe Operations: Preview changes, backup options, and transaction support
- Multiple Interfaces: Both GUI and CLI interfaces available
- Schema Validator & Analyzer
- Bulk Data Generator with relationships
- Data Quality Checker
- Migration Assistant
- Python 3.8 or higher
- MySQL 8.0 or higher
- 50MB free disk space
# Clone the repository
git clone https://github.com/yourusername/dda-toolkit.git
cd dda-toolkit
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize the name databases
python scripts/init_names.pydocker pull dda-toolkit/dda:latest
docker run -p 8080:8080 dda-toolkit/ddadda-toolkit/
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ main.py # Main entry point
βββ config/ # Configuration files
β βββ database_config.yaml # Database connection settings
β βββ tool_config.yaml # Tool behavior settings
βββ data/ # Data files
β βββ names/ # Name databases
β β βββ female_names.csv # Female names (grouped)
β β βββ male_names.csv # Male names (grouped)
β βββ sample_datasets/ # Sample data for testing
βββ src/ # Source code
β βββ core/ # Core functionality
β β βββ database_manager.py # Database connection & operations
β β βββ validator.py # Input validation
β βββ tools/ # Individual tools
β β βββ name_generator.py # Name Randomizer Tool
β β βββ data_generator.py # Future: General data generator
β β βββ schema_validator.py # Future: Schema analysis
β βββ ui/ # User interfaces
β β βββ gui_app.py # Tkinter GUI application
β β βββ cli_interface.py # Command-line interface
β βββ utils/ # Utility functions
β βββ file_manager.py # File operations
β βββ logger.py # Logging configuration
βββ scripts/ # Utility scripts
β βββ init_names.py # Initialize name databases
β βββ backup_tool.py # Database backup utility
βββ tests/ # Test suite
β βββ test_name_generator.py
β βββ test_database_manager.py
βββ docs/ # Documentation
βββ user_guide.md
βββ api_reference.md
# Launch the graphical interface
python main.py --gui# Show available commands
python main.py --help
# Run Name Randomizer Tool
python main.py --tool name-generator --db your_database --table employees-
Launch the Tool
python main.py --gui
-
Configure Database Connection
- Enter MySQL host, port, username, and password
- Click "Test Connection" to verify
- Select your database from the dropdown
-
Select Target Table
- Choose a table from the detected list (tables with gender columns)
- View table schema and sample data
- Select gender column (auto-detected)
- Select name column(s) to update
-
Configure Name Settings
- Choose gender(s) to update: Male, Female, or Both
- Select name groups: English, Arabic, Asian, African, or All
- Set distribution: Equal chance or Proportional (matching group sizes)
- Configure update scope: All rows or filtered subset
-
Preview & Execute
- Click "Preview Changes" to see sample updates
- Choose backup options (recommended)
- Select "Dry Run" to test without changes
- Click "Execute Update" to apply changes
# Update female first names with English and Arabic names
python main.py --tool name-generator \
--host localhost \
--user root \
--db company_db \
--table employees \
--gender-col gender \
--name-col first_name \
--gender female \
--groups English,Arabic \
--distribution proportional
# Update both genders in multiple name columns
python main.py --tool name-generator \
--db customer_db \
--table customers \
--gender-col sex \
--name-col "first_name,last_name" \
--gender both \
--groups all \
--where "age > 18" \
--limit 1000 \
--backup yes
# Preview changes without executing
python main.py --tool name-generator \
--db test_db \
--table users \
--dry-run yes \
--preview-rows 20The tool comes pre-loaded with categorized names:
- 60 English/Western: Emma, Olivia, Ava, Sophia, Charlotte...
- 20 Arabic: Fatima, Aisha, Zainab, Mariam, Sarah...
- 20 Asian/African: Mei, Sakura, Priya, Amina, Zahara...
- 60 English/Western: James, John, Robert, Michael, William...
- 20 Arabic: Mohammed, Ali, Omar, Ahmed, Hassan...
- 20 Asian/African: Wei, Kenji, Kwame, Chijioke, Tunde...
Edit the CSV files in data/names/ to add your own names:
Format:
group,name
English,Emma
English,Olivia
Arabic,Fatima
Arabic,Aisha
Asian,Mei
African,ZaharaTo add new names:
# Edit the CSV files directly
nano data/names/female_names.csv
# Or use the included management script
python scripts/manage_names.py --add --gender female --group "NewGroup" --name "NewName"default_connection:
host: localhost
port: 3306
user: root
charset: utf8mb4
connection_timeout: 10
backup_settings:
enabled: true
location: ./backups
keep_last: 5
safety_settings:
max_rows_per_update: 10000
require_confirmation: true
transaction_size: 1000name_generator:
default_distribution: proportional
allow_duplicates: false
preserve_null: true
case_sensitive: false
logging:
level: INFO
file: ./logs/dda.log
max_size_mb: 10
backup_count: 5# Update names with custom WHERE clause
python main.py --tool name-generator \
--db mydb \
--table users \
--where "department = 'Sales' AND hire_date > '2023-01-01'"# Process in batches of 5000 rows
python main.py --tool name-generator \
--db large_db \
--table huge_table \
--batch-size 5000 \
--threads 4# Use as a Python module
from src.tools.name_generator import NameRandomizer
randomizer = NameRandomizer(host='localhost', user='root', database='mydb')
config = {
'table': 'employees',
'gender_column': 'gender',
'name_columns': ['first_name'],
'target_gender': 'female',
'name_groups': ['English', 'Arabic']
}
result = randomizer.execute_update(config)Run the test suite to ensure everything works correctly:
# Run all tests
python -m pytest tests/
# Run specific test file
python -m pytest tests/test_name_generator.py -v
# Run with coverage report
python -m pytest tests/ --cov=src --cov-report=htmlThe tool provides comprehensive logging:
- Application Logs:
logs/dda.log - Change Logs:
logs/changes/(per-execution) - Error Logs:
logs/errors/
View logs in real-time:
tail -f logs/dda.log- Never commit credentials: Database credentials are stored in config files excluded from git
- Use environment variables for production:
export DDA_DB_PASSWORD="your_secure_password"
- Backup before operations: Always enable backup for production databases
- Use read-only mode first: Preview changes before executing
- Limit permissions: Use database users with minimal required permissions
We welcome contributions! Here's how to help:
- Report Bugs: Use the GitHub issue tracker
- Suggest Features: Open an issue with the "enhancement" label
- Submit Code: Fork the repo and create a pull request
- Improve Documentation: Help us make the docs better
# Fork and clone the repository
git clone https://github.com/yourusername/dda-toolkit.git
cd dda-toolkit
# Install development dependencies
pip install -r requirements-dev.txt
# Set up pre-commit hooks
pre-commit install
# Create a feature branch
git checkout -b feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for the database development community
- Names databases curated from various open sources
- Inspired by real-world database development challenges
- Documentation: docs.dda-toolkit.org
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@dda-toolkit.org
- Schema Validator Tool
- Export/Import name databases
- Docker support
- Bulk Data Generator
- Web-based GUI
- PostgreSQL support
- Multi-database operations
- Machine learning for name suggestions
- API server mode
Happy Database Developing! π
If you find this tool useful, please give it a β on GitHub!