Skip to content

lamphung1/cs361microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Microservice for randomly generated movie

The microservice uses "themoviedb" API to return a randomly selected movie in JSON format.

Request Data

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

  1. pip install the packages at the top of the randomMicroservice.py file , including dotenv (for python use)
  2. create a local .env file and store the personal authentication token as a variable (the microservice will pull that token once called)
  3. once valid token is accepted, import the randomMovie() method into your mainApp.py (your main CLI app)
  4. perform your logic to ensure that the user wants a randomly generated movie (i.e if user_input == random...)
  5. call the randomMovie() method (no parameters), to begin the request for a randomly generated movie

Recieve Data

  1. Once randomMovie() is called, the movie_ID of the newest database entry from 'themoviedb' will be obtained
  2. A random movie_id will be generated in range(1, newest db entry movie_id)
  3. 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
  4. The returned data can be stored in a variable, and the user can the parse through the data as they need to.

UML

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages