Code Monkey home page Code Monkey logo

deint's Introduction

TASK1

Converting JSON files into DB tables and manipulating data using SQL queries and completed loading all finished results into JSON file.

1) in terminal write a command ->

docker-compose up --build

after then will be created docker container with DB PostgreSQL 16 and base credentials as in file docker-compose.yml (docker and postgres must be installed on your computer before)

2) connect with DB with credentials from docker-compose.yml
you can change all credentials but before building of DB

3) all SQL queries exist in SQL_task1.sql
you can find it in general folder of project it's queries and index optimization

4) according on SQL queries in psql_query_terminal.txt you can use commands in terminal for creating new JSON files with results of each queries
psql_query_terminal.txt

5) inside py_test folder test_json_files.py
this test check of file in jsons_file if did have JSON files in folder or not and if this file exist test check that files not empty
pytest will be installed (for example pip install pytest)

6) start test with ->

pytest -vs test_json_files.py

project scheme

task1/  (main directory)
|         jsons/  (work directory)
|         |         jsons_file/  (JSON's file directory)
|         |         |                 - rooms.json
|         |         |                 - students.json
|         |         - .gitignore
|         |         - config.py
|         |         - data_loader.py
|         |         - database.py
|         |         - main.py
|         |         - pre-commit-config.yaml
|         |         - requirements.txt
|         py_test/  (tests directory)
|         |             - test_json_files.py
|         sql_query_results/  (SQL queries results in JSON directory)
|         |                               - rooms_students_count.json
|         |                               - rooms_with_multiple_genders.json
|         |                               - top_5_rooms_by_age_range.json
|         |                               - top_5_rooms_by_average_age.json
|         - docker-compose.yml
|         - dockerfile
|         - psql_query_terminal.txt
|         - SQL_task1.sql

deint's People

Contributors

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