This project is a simple integration connector (client) for the RickAndMorty API (https://rickandmortyapi.com/) - test task solution. It fetches data related to characters, locations, and episodes from the RickAndMorty API and performs specified tasks.
-
Fetch Entire API Data: Retrieve the entire dataset from the API for the entities:
- Character
- Location
- Episode
-
JSON File Output: The fetched data is stored in distinct JSON files.
-
JSON Data Structure: The structure for each JSON file is:
Id
: A generated unique GUID.Metadata
: The name extracted from the respective entity.RawData
: The comprehensive fetched JSON data presented as a dictionary.
Upon the program's successful execution, it will display:
- Names of episodes aired between 2017 and 2021 that encompass more than three characters.
- Locations that are exclusively mentioned in episodes with odd numbers (e.g., episodes 1, 3, 9 irrespective of their season).
- Python 3.6 or higher
- Requests library
- Clone this repository.
- Create a virtual environment:
python3 -m venv myenv
. - Activate the virtual environment:
source myenv/bin/activate
(Linux/Mac) ormyenv\Scripts\activate
(Windows). - Install the required packages:
pip3 install -r requirements.txt
.
Simply run the main script:
python3 main.py