- This repository contains scripts to access and manipulate user data from the DummyAPI.io.
- The API data is retrieved and stored in a MySQL database using Python scripts.
- The repository includes a Docker Compose file for containerization and easy deployment.
- Docker
- Python 3.X or higher
- pip
- mysql-connector-python-library
- requests library
- Clone the repository
git clone https://github.com/<username>/<repository>.git
- Install dependencies
pip install -r requirements.txt
- Build the Docker container:
docker-compose up -d
- Log into the MySQL database
mysql -h 127.0.0.1 -P 8083 -u root -p
-
Password: pwd
-
Execute the
000_CreateDB.sql
script in MySQL Shell to create the database and tables
\sql
source (repository_location)/sql_scripts/000_CreateDB.sql
- Open
database.py
- Update the
config
dictionary with the correct values for your MySQL server.
- Open
api_connection.py
in text editor - Update the
app_id
variable with your own app ID. (You can get one from dummyapi.io) - Run the script using the following command:
python api_connection.py
-
The
api_connection.py
anddatabase.py
scripts assume that the Docker container is running. -
The
api_connection.py
script will fetch data from the dummyapi.io API and insert it into the MySQL database. -
The
database.py
script will retrieve the data from the MySQL database and print it to the console. -
The
config
dictionary in thedatabase.py
script should be updated with the correct values for your MySQL server.
- Please open an issue for support.
- Pull requests are welcome. Please make sure that your changes are tested before submitting a pull request.
- MIT