Skip to main content

Get information on characters, quotes and more from the lord of the rings.

Project description

LOTR SDK

The LOTR SDK is a python SDK for retrieving book titles, movie titles, characters and quotes related to the Lord of the Rings Trilogy. It is built as a client to the one API, which provides data on the lord of the rings.

Installation

Use the package manager pip to install the requests library and the LOTR SDK.

pip install requests
pip install avisochek-sdk

You will also need an API key from the one API, which you can get by signing up here.

Usage

from LOTR.lotr import LOTR
from pprint import PrettyPrinter
pp = PrettyPrinter()

# initialize a client
lotr = LOTR(`<your API Key>`)

# Get a list of books.
list_of_books = lotr.get_book_info()
print("Lord Of The Rings Books:")
pp.pprint(list_of_books)

# Get a list of movies.
list_of_movies = lotr.get_movie_info()
print("Lord Of The Rings Movies:")
pp.pprint(list_of_movies)

# Get a list of characters.
list_of_characters = lotr.get_character_info()
print("10 Characters From Lord of the Rings:")
pp.pprint(list_of_characters[0:10])

movie_id = list_of_movies[6]["_id"]
movie_name = list_of_movies[6]["name"]
# Get a list of quotes from a particular movie
# (only works for lord of the rings trilogy for now)
quotes_from_movie = lotr.get_quotes_from_movie(movie_id)
print(f"10 Quotes From {movie_name}:")
pp.pprint(quotes_from_movie[0:10])

# Get a list of quotes from a particular character
quotes_from_frodo = lotr.get_quotes_from_character("5cd99d4bde30eff6ebccfc15")
print("10 Quotes From Frodo Baggins:")
pp.pprint(quotes_from_frodo[0:10])

book_id = list_of_books[0]["_id"]
book_name = list_of_books[0]["name"]
# Get a list of chapters from the first book
book_chapters = lotr.get_book_chapters(book_id)
print(f"Chapters From {book_name}:")
pp.pprint(book_chapters)

License

MIT

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

avisochek-sdk-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

avisochek_sdk-0.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file avisochek-sdk-0.0.2.tar.gz.

File metadata

  • Download URL: avisochek-sdk-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for avisochek-sdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5e128cc765d90a4e04d8a2647358a99793215b7a0b64fa02d0da2edcd39683d8
MD5 5d61b38e52264dc6ff54330b3bc0c5ff
BLAKE2b-256 edd86b3f5ed12d465cc4ec48c167efa9f85696695c85b0dc6500fcfebcfb3d25

See more details on using hashes here.

File details

Details for the file avisochek_sdk-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for avisochek_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e453faa7286d79ca172e38a177b70fb7f4e4fc58c08a3cb1d8b0ef81cfd3a62
MD5 167ad179d3bd42e327abc618e3691e60
BLAKE2b-256 c063924bc41889a9c28a8805a1ee8d0b3193118696fa35131e31bda0d02b1ca9

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