DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Fresh Tomatoes guys
Sourav das
Sourav das

Posted on

Fresh Tomatoes guys

Alright let me clear I am not opening any tomato shop :)

I am gonna show you how to get any movie rottentomatoes score using my python package.
Let me show you,

import freshtomatoes as ft
movie=ft.FreshTomatoes()
aladdin=movie.Scores("aladdin")
coco=movie.Scores("coco",2017)

print("Aladdin:- ",aladdin)
print("Coco:- ",coco)
Enter fullscreen mode Exit fullscreen mode

Output

Aladdin:-  {'audiencescore': '94', 'tomatometerscore': '57'}
Coco:-  {'audiencescore': '94', 'tomatometerscore': '97'}

Enter fullscreen mode Exit fullscreen mode

As you can see it is returnig a dictionary containing two info

  • audiencescore
  • tomatometerscore

syntax

import freshtomatoes as ft
movie=ft.FreshTomatoes()
movie.Scores("MOVIE_NAME")
#or
name=movie.Scores("MOVIE_NAME",MOVIE_RELEASE_YEAR)

Enter fullscreen mode Exit fullscreen mode

So as you can see it is pretty simple now to get a movie's rottentomatoes scores.

So why wait install and try it now .

pip install freshtomatoes
Enter fullscreen mode Exit fullscreen mode

Visit on pypi.org:- https://pypi.org/project/freshtomatoes/

Want to contribute ?

Check the repo :- https://github.com/freakflames29/FreshTomatoes

Top comments (2)

Collapse
 
turry profile image
Turry

Cool guide, I like it!
One idea is to substitute the
movie.Scores(β€œaliddin”)
To maybe
movie.Scores(text)
Where:
text = input(Enter the movie name: )
Else print movie not found!

Collapse
 
freakflames29 profile image
Sourav das

Yes! in this case if a movie is not found it will return an empty dictionary

Let's Get Wacky


Use any Linode offering to create something unique or silly in the DEV x Linode Hackathon 2022 and win the Wacky Wildcard category

β†’ Join the Hackathon <-