Code Monkey home page Code Monkey logo

task_1's Introduction

Task 1 database application

This is a small application for processing student database.

Purpose:

This project provides a command-line interface for interacting with a MySQL database containing student and room data. It offers two main functionalities:

Data Import: Allows importing room and student data from JSON files into the database. Data Export: Enables exporting various reports based on the database content to a JSON file.

Installation: Ensure Python and mysql-connector-python are installed.

Configuration: In config.py, set your MySQL connection details.

Import:

  • python main.py import [rooms_path] [students_path]
  • rooms_path (optional): Path to JSON file containing room data (default: rooms.json).
  • students_path (optional): Path to JSON file containing student data (default: students.json).

Export:

  • python main.py export [export_type] [export_path]
  • export_type: Type of report to export (default: all).
    • all: Export all reports in separate sections within a single JSON file.
    • count: Export rooms with the number of students.
    • avg: Export 5 rooms with the minimum average student age.
    • dif: Export 5 rooms with the maximum difference in student ages.
    • sex: Export rooms with both male and female students.
  • export_path (optional): Path to save the exported data (default: format.json).

Additional Notes:

Use python main.py --help for detailed usage information. Modify config.py to adjust database connection settings.

task_1's People

Contributors

samsdimko avatar enfazz 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.