Skip to main content

A micro lord of the rings sdk

Project description

Lord Of The Rings SDK

Description: An SDK that makes it easy for developers to consume information about the Lord of The Rings trilogy.

SDK builds on an existing Lord of The Rings API

Tech Stack

Built using Python 3.10.5 (see .python-version file). External libraries are kept as minimal as possible (see requirements.in file)

Installation

pip install lord-aubrey-of-the-rings

Run

Register and login here to get your access token.

Import the class LordOfTheRings and call the available methods, passing params where necessary. Example:

from lord_of_the_rings.endpoints import LordOfTheRings

client = LordOfTheRings(access_token='your_access_token')

client.get_books()
client.get_movies('5cd95395de30eff6ebccde5b')
client.get_characters('5cd99d4bde30eff6ebccfe2e', 'quote')

There are also the options of

Pagination:

client.get_characters(limit=2)
client.get_characters(page=3)
client.get_characters(offset=11)

Sorting:

client.get_books(sort='name:asc')
client.get_quotes(sort='dialog:desc')

and Filtering:

client.get_characters(name='Gandalf')
client.get_characters(race='Hobbit,Human')

Consult the API docs for more information

Exposed methods:

METHOD          : PARAMETER(S)
get_books       : identifier (optional), 'chapter' (optional, requires identifier)
get_movies      : identifier (optional), 'quote' (optional, requires identifier)
get_characters  : identifier (optional), 'quote' (optional, requires identifier)
get_quotes      : identifier (optional)
get_chapters    : identifier (optional)

Install (to run SDK locally)

Clone github repo and run the following code. It creates a fresh virtual environment (called .venv) and installs requirements

make setup

Install pip requirements / Sync requirements.in with requirements.txt

make pip_sync

Run tests

make runtest

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

lord-aubrey-of-the-rings-0.1.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

lord_aubrey_of_the_rings-0.1.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

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