This project is a simple Flask application that serves as a backend for retrieving information about Golden Raspberry Awards nominees and winners in the category of Worst Film.
It provides a RESTful API to load and query data about producers with the longest and shortest intervals between consecutive wins, as well as to retrieve intervals for specific producers.
When uploading the data, the project directory should be structured as follows:
project/
│
├── app.py
├── data/
│ └── movielist.csv
│
└── tests/
└── test_csv_format.p
app.py
: The main Flask application file.data/
: Directory containing the CSV file with Golden Raspberry Awards data.tests/
: Directory containing the integration tests for the Flask application.
These instructions will help you set up and run the project on your local machine.
- Python 3.x
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/GAFonseca/backendapptest.git
- Navigate to the project directory:
cd backendapptest
- Set up a virtual environment (optional but recommended):
python -m venv venv
4.Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
To run the Flask application, execute the following command:
python app.py
The application will start running on http://localhost:5000/ by default.
To run the integration tests, execute the following command:
python -m unittest discover tests
This command will discover and run all the test files within the tests directory.
GET /api/producers: Retrieve minimum and maximum intervals for all producers. GET /api/producers/<producer_name>: Retrieve minimum and maximum intervals for a specific producer.
The CSV file containing the Golden Raspberry Awards data should have the following format:
year;title;studios;producers;winner
- Flask - Web framework for Python
- SQLite - Embedded relational database
- unittest - Unit testing framework for Python
##License
This project is licensed under the MIT License - see the LICENSE file for details.