This project is a Python script that generates sample data for a database based on a YAML configuration file. It can be used to populate a database with sample data for testing or development purposes.
Before running the script, ensure you have the following installed:
- Python (version 3.9 or higher)
- Docker
-
Clone this repository to your local machine:
git clone https://github.com/your_username/database-sample-data-generator.git
-
Navigate to the project directory:
cd database-sample-data-generator
-
Install the required Python packages:
pip install -r requirements.txt
- Edit the
database_config.yaml
file to specify the database configuration and table definitions. - Ensure that the YAML file contains the necessary information such as database host, user, password, database name, table names, columns, data types, and the number of records to generate.
-
Build the Docker image:
docker build -t data-generator .
-
Run the Docker container:
docker run --rm -v $(pwd)/database_config.yaml:/app/database_config.yaml data-generator
-
Ensure that PostgreSQL is running on your local machine or update the database configuration in the YAML file to point to a remote database server.
-
Run the Python script:
python python_script.py
This project is licensed under the MIT License - see the LICENSE file for details.