NinetyOne Test Scores Application
Overview & Design Choices
CSV Parsing
- Approach:
The application uses a simple string split method to parse the CSV file manually. This satisfies the requirement of not using any standard CSV-parsing libraries. - Assumption:
The parser assumes that CSV fields do not contain commas, which fits the provided sample data.
Database
- Choice:
SQLite is chosen for its simplicity and ease of setup in a local development environment. ALso no need for hosting connection via ports like mysql server - Implementation:
SQLAlchemy is used as the ORM, which helps manage database interactions and makes the code more maintainable.
API Framework
- Choice:
Flask is used to build the RESTful API because it is lightweight and straightforward, making it ideal for small applications like this one.
Running the Application
CSV-to-DB Script
- Purpose:
The script reads data from a plain-text CSV file (TestData.csv), parses it, inserts the records into a SQLite database, and outputs the top scorer(s) along with the top score to STDOUT. - How to Run:
Open a terminal in the project directory and execute:
python main.py