The microservice uses "themoviedb" API to return a randomly selected movie in JSON format.
User must import the randomMicroservice.py to their local workspace. An authentication token must be generated from themoviedb.com after account creation.
To use the microservice, the user should
- pip install the packages at the top of the randomMicroservice.py file , including dotenv (for python use)
- create a local .env file and store the personal authentication token as a variable (the microservice will pull that token once called)
- once valid token is accepted, import the randomMovie() method into your mainApp.py (your main CLI app)
- perform your logic to ensure that the user wants a randomly generated movie (i.e if user_input == random...)
- call the randomMovie() method (no parameters), to begin the request for a randomly generated movie
- Once randomMovie() is called, the movie_ID of the newest database entry from 'themoviedb' will be obtained
- A random movie_id will be generated in range(1, newest db entry movie_id)
- That random movie_id will be used to extract a movie and it's details, and that will be returned to user in a dictionary
- The returned data can be stored in a variable, and the user can the parse through the data as they need to.
