Welcome to asynctmdb’s documentation!¶
Subpackages¶
methods package¶
authentication methods module¶
-
asynctmdb.methods.authentication.
create_request_token
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession, date_time_format: str = '%Y-%m-%d %H:%M:%S %Z') → typing.Dict[str, typing.Union[int, str, datetime.datetime]][source]¶ Create a temporary request token that can be used to validate a TMDb user login.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
create_session
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, request_token: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Union[int, str]][source]¶ Create a fully valid session.
This method can be used once a user has validated the request token.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
validate_request_token
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, username: str, password: str, request_token: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Union[int, str]][source]¶ Validate a request token with username and password.
Caution
Please note, using this method is strongly discouraged.
The preferred method of validating a request token is to have a user authenticate the request via the TMDb website.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
create_guest_session
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession, date_time_format: str = '%Y-%m-%d %H:%M:%S %Z') → typing.Dict[str, typing.Union[int, str, datetime.datetime]][source]¶ Create a new guest session.
Guest sessions are a type of session that will let a user rate movies and TV shows but not require them to have a TMDb user account.
More information about user authentication can be found here.
Please note, there should be generated only a single guest session per user (or device) as you will be able to attach the ratings to a TMDb user account in the future.
There is also IP limits in place so you should always make sure it’s the end user doing the guest session actions.
If a guest session is not used for the first time within 24 hours, it will be automatically deleted.
More info at TMDb docs.
find methods module¶
-
asynctmdb.methods.find.
by_id
(external_id: str, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, external_source: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Search for objects by an external id (for instance, an IMDb ID).
This method will search all objects (movies, TV shows and people) and return the results in a single response.
The supported external sources for each object are as follows.
Movies TV Shows TV Seasons TV Episodes People IMDb ID ✓ ✓ ✗ ✓ ✓ Freebase MID ✗ ✓ ✓ ✓ ✓ Freebase ID ✗ ✓ ✓ ✓ ✓ TVDB ID ✗ ✓ ✓ ✓ ✗ TVRage ID ✗ ✓ ✓ ✓ ✓ More info at TMDb docs.
genres methods module¶
movies methods module¶
-
asynctmdb.methods.movies.
details
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, append_to_response: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the primary information about a movie.
Supports
append_to_response
. Read more about this here.More info at TMDb docs.
-
asynctmdb.methods.movies.
account_states
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session_id: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Grab the following account states for a session:
- Movie rating
- If it belongs to your watchlist
- If it belongs to your favourite list
More info at TMDb docs.
-
asynctmdb.methods.movies.
alternative_titles
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, country: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get all of the alternative titles for a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
changes
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, start_date: datetime.datetime = None, end_date: datetime.datetime = None, page: int = None, session: aiohttp.client.ClientSession, format_string: str = '%Y-%m-%d %H:%M:%S %Z') → typing.Dict[str, typing.Any][source]¶ Get the changes for a movie.
By default only the last 24 hours are returned.
You can query up to 14 days in a single query by using the
start_date
andend_date
query parameters.More info at TMDb docs.
-
asynctmdb.methods.movies.
credits
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the cast and crew for a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
images
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, include_image_language: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the images that belong to a movie.
Querying images with a
language
parameter will filter the results.If you want to include a fallback language (especially useful for backdrops) you can use the
include_image_language
parameter. This should be a comma seperated value like so:include_image_language="en,null"
More info at TMDb docs.
-
asynctmdb.methods.movies.
keywords
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the keywords that have been added to a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
release_dates
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession, format_string: str = '%Y-%m-%dT%H:%M:%S.%fZ') → typing.Dict[str, typing.Any][source]¶ Get the release date along with the certification for a movie.
Release dates support different types:
- Premiere
- Theatrical (limited)
- Theatrical
- Digital
- Physical
- TV
More info at TMDb docs.
-
asynctmdb.methods.movies.
videos
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the videos that have been added to a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
translations
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get a list of translations that have been created for a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
recommendations
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, session: aiohttp.client.ClientSession, format_string: str = '%Y-%m-%d') → typing.Dict[str, typing.Any][source]¶ Get a list of recommended movies for a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
similar
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, session: aiohttp.client.ClientSession, format_string: str = '%Y-%m-%d') → typing.Dict[str, typing.Any][source]¶ Get a list of similar movies.
This is not the same as the “Recommendation” system you see on the website.
These items are assembled by looking at keywords and genres.
More info at TMDb docs.
-
asynctmdb.methods.movies.
reviews
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the user reviews for a movie.
More info at TMDb docs.
-
asynctmdb.methods.movies.
lists
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get a list of lists that this movie belongs to.
More info at TMDb docs.
-
asynctmdb.methods.movies.
rate
(movie_id: int, *, rating: float, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, guest_session_id: str = None, session_id: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Rate a movie.
A valid session or guest session ID is required. You can read more about how this works here.
More info at TMDb docs.
-
asynctmdb.methods.movies.
delete_rating
(movie_id: int, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, guest_session_id: str = None, session_id: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Remove your rating for a movie.
A valid session or guest session ID is required. You can read more about how this works here.
More info at TMDb docs.
-
asynctmdb.methods.movies.
latest
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the most newly created movie.
This is a live response and will continuously change.
More info at TMDb docs.
-
asynctmdb.methods.movies.
now_playing
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, region: str = None, session: aiohttp.client.ClientSession, format_string: str = '%Y-%m-%d', dates_keys: typing.Iterable[str] = ['minimum', 'maximum']) → typing.Dict[str, typing.Any][source]¶ Get a list of movies in theatres.
This is a release type query that looks for all movies that have a release type of 2 or 3 within the specified date range.
You can optionally specify a
region
parameter which will narrow the search to only look for theatrical release dates within the specified country.More info at TMDb docs.
-
asynctmdb.methods.movies.
popular
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, region: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get a list of the current popular movies on TMDb.
This list updates daily.
More info at TMDb docs.
-
asynctmdb.methods.movies.
top_rated
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, region: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get the top rated movies on TMDb.
More info at TMDb docs.
-
asynctmdb.methods.movies.
upcoming
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, page: int = None, region: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Get a list of upcoming movies in theatres.
This is a release type query that looks for all movies that have a release type of 2 or 3 within the specified date range.
You can optionally specify a region parameter which will narrow the search to only look for theatrical release dates within the specified country.
More info at TMDb docs.
IMDb package¶
find module¶
-
asynctmdb.imdb.find.
movie
(imdb_id: str, *, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, language: str = None, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Any][source]¶ Search TMDb movie details by IMDb ID.
Raise: ValueError
if IMDb ID is invalid or there is no details found.
Submodules¶
common module¶
requests module¶
-
asynctmdb.requests.
send
(*, method: typing.Callable[[aiohttp.client.ClientSession, str, typing.Any], asynctmdb.types.AsyncContextManager], method_url: str, session: aiohttp.client.ClientSession, json_body: typing.Dict[str, typing.Any] = None, **params: typing.Dict[str, str]) → typing.Dict[str, typing.Any][source]¶ Perform HTTP request with JSON-serializable response.