-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need more detail documentations. #43
Comments
which way calling Movie is better? |
A good place to find more documentation and examples is the Closed Issues. |
You can call Movies() either way. It's a matter of preference. Movie Examplesimport tmdbsimple as tmdb
tmdb.API_KEY = 'YOUR_API_KEY_HERE' Call Format 1 - Instance attributesCreate an instance of the type Movies. Call methods on the instance (movie.info(), movie.videos(), and movie.images()). Then you can access the instance attributes (movie.title, movie.results, movie.posters[0]). See The Movie Database API for the names of the attributes. For example, https://developers.themoviedb.org/3/movies/get-movie-details for info() attributes. movie = tmdb.Movies(342) info = movie.info()
videos = movie.videos()
images = movie.images() movie.title, movie.results, movie.posters[0]
Call Format 2 - Direct AccessIf you don't create an instance, you need to access the dict values directly. info = tmdb.Movies(342).info()
videos = tmdb.Movies(342).videos()
images = tmdb.Movies(342).images() info['title'], videos['results'], images['posters'][0]
|
so calling two option have no different performance? |
For this kind of programming, it's more important to care about readability than execution speed. |
would you provide more detail in documents with more examples? like how to use popular movies or pagination etcs.
The text was updated successfully, but these errors were encountered: