Git Product home page Git Product logo

dockerized_database's Introduction

Rest API for DummyAPI.io

  • 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.

Pre-requisites

  • Docker
  • Python 3.X or higher
  • pip

Requirements

  • mysql-connector-python-library
  • requests library

Installation

  • 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

Usage

database.py

  • Open database.py
  • Update the config dictionary with the correct values for your MySQL server.

api_connection.py

  • 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

Note

  • The api_connection.py and database.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 the database.py script should be updated with the correct values for your MySQL server.


Support

  • Please open an issue for support.

Contributors

  • Pull requests are welcome. Please make sure that your changes are tested before submitting a pull request.

License

  • MIT

dockerized_database's People

Contributors

arogan178 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.