Skip to main content

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


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.3.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

myapimovies-0.0.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file myapimovies-0.0.3.tar.gz.

File metadata

  • Download URL: myapimovies-0.0.3.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for myapimovies-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b23b9b454bf06d45d860e3c1d317be909601d9c554d4445d6d81f4e28ec9fff9
MD5 a9421580ea4934274d63bdcdba11518a
BLAKE2b-256 cd09771857e6bea1bdcbe527db8d8be817670ee26f69910630202954ab4ffb3b

See more details on using hashes here.

File details

Details for the file myapimovies-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: myapimovies-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for myapimovies-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6dd18d8290995e226a23e6de1076353bdefdaa8faabd5b082b50a75762084b3
MD5 fabec05aac8eaf690f8498a6f2b564a0
BLAKE2b-256 4653ed7e34d38d9b246e792919e06667b33eeb0ff8c412ca47f9e39643394449

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page