API client for MyApiMovies
Project description
MyApiMovies API Client
This client facilitates MyApiMovies API calls. You only need a token that you can obtain by registering here
Init the client
Initialize the class MyApiMovies
with your token
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
Examples
Getting movie by id
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
IMDB_ID_AVENGERS_ENDGAME = 'tt4154796'
response = client.movie(imdb_id=IMDB_ID_AVENGERS_ENDGAME)
first_result = response.data[0]
print(f'ImdbId: {first_result.imdbId}')
print(f'Title: {first_result.title}')
print(f'Year: {first_result.year}')
print(f'Poster: {first_result.posterUrl}')
Search movie
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
title = 'Yesterday'
year = 2019
response = client.movie_search(title=title, year=year)
first_result = response.data[0]
print(f'ImdbId: {first_result.imdbId}')
print(f'Title: {first_result.title}')
print(f'Year: {first_result.year}')
print(f'Poster: {first_result.posterUrl}')
Similar movies
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
IMDB_ID_AVENGERS_ENDGAME = 'tt4154796'
response = client.similar_movies(imdb_id=IMDB_ID_AVENGERS_ENDGAME)
first_result = response.data[0]
print(f'ImdbId: {first_result.imdbId}')
print(f'Title: {first_result.title}')
print(f'Year: {first_result.year}')
print(f'Poster: {first_result.posterUrl}')
Several data at the same time about a movie
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
args = {
'imdbId': 'tt0133093',
'actors': 'main==true;page==1',
'akas': ''
}
response = client.movie_all_in_one(args=args)
first_result = response.data[0]
actors_first_result = first_result.actors.data[0]
print(f'Character: {actors_first_result.character}')
print(f'Character url: {actors_first_result.characterUrl}')
print(f'Main: {actors_first_result.main}')
aka_first_result = first_result.akas.data[0]
print(f'Title: {aka_first_result.title}')
print(f'Country: {aka_first_result.country.country}')
movie_first_result = first_result.movie.data
print(f'ImdbId: {movie_first_result.imdbId}')
print(f'Title: {movie_first_result.title}')
print(f'Year: {movie_first_result.year}')
print(f'Poster: {movie_first_result.posterUrl}')
Search person
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
IMDB_ID_JIM_PARSONS = 'nm1433588'
response = client.name(imdb_id=IMDB_ID_JIM_PARSONS)
first_result = response.data[0]
print(f'ImdbId: {first_result.imdbId}')
print(f'Actor: {first_result.actorActress}')
print(f'Biography: {first_result.biography}')
print(f'Photo: {first_result.photoUrl}')
Several data at the same time about a person
from myapimovies import MyApiMovies
client = MyApiMovies('<TOKEN>')
IMDB_ID_JIM_PARSONS = 'nm1433588'
args = {
'imdbId': IMDB_ID_JIM_PARSONS,
'alternative': ''
}
response = client.name_all_in_one(args=args)
first_result = response.data[0]
name_first_result = first_result.name.data
print(f'ImdbId: {name_first_result.imdbId}')
print(f'Actor: {name_first_result.actorActress}')
print(f'Biography: {name_first_result.biography}')
print(f'Photo: {name_first_result.photoUrl}')
alternative_not_found = first_result.alternative
# No alternate name
print(f'Code: {alternative_not_found.code}')
print(f'Error: {alternative_not_found.error}')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
myapimovies-0.0.2.tar.gz
(23.6 kB
view details)
Built Distribution
File details
Details for the file myapimovies-0.0.2.tar.gz
.
File metadata
- Download URL: myapimovies-0.0.2.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb87bf61348b7132939e79aa004cd73a89f80d2dab71bd70e68c8f5efe3934e5 |
|
MD5 | 0b1b55f5378cd7e847af88387e2c04c8 |
|
BLAKE2b-256 | 88512661696a66dbeb1919090dfa296d3e146ead2cf4789286b05abc9bbbdff4 |
File details
Details for the file myapimovies-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: myapimovies-0.0.2-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a910b6ac56f270249c38846bf589b84590d71421bc6a1a636558389c5f9b70 |
|
MD5 | 8078f296755a4df2bf6e0c75dcacb635 |
|
BLAKE2b-256 | 7378d00dfd0a7a7b7aa03991d2eca6d51f6c57f8b8afb6a3e58fc133664a046c |