Skip to main content

Lord Of the Rings Python SDK

Project description

dinesh_ketumakha-SDK

This is the python sdk for accessing https://the-one-api.dev/ server's endpoints related to Lord Of the Rings movies & quotes.

Installation

To install using pip do the following in a virtual environment

$ mkdir my_lotr_test_dir
$ cd my_lotr_test_dir
$ python3 -m venv venv
$ pip install lotrpy

Usage

The following is how you can use this SDK

from lotrpy.lotr import LOTR

token = "bearer_token_value"
base_url = "https"//server.com/api/v1"

lotr = LOTR(token, base_url)

# get all movies
lotr.get_movies()

# get all movies on page 2 if there was more than 1 page 
# in the response above
lotr.get_movies(page=2)

# get all movies, limit each response to 5  items
lotr.get_movies(limit = 5)

# get info on a single movie
movie_id = "123lkdlfs"
lotr.get_movie(movie_id)

# get all quotes. paging and limit apply just like above
lotr.get_quotes()

# get all quotes from one specific movie
lotr.get_quotes_from_movie(movie_id)

# get one specific quote. Need to get the quote_id from 
# response of get_quotes()
lotr.get_quote(quote_id) 

Testing

To run the tests, install pytest in the venv created above

$ pip install pytest

Clone this repo and cd into the root of the directory

$ git clone https://github.com/gypsyx/dinesh_ketumakha-SDK.git

$ cd dinesh_ketumakha-SDK
$ pytest # runs all tests

To run just unit tests

$ pytest -k unit

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

lotrpy-1.0.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lotrpy-1.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file lotrpy-1.0.1.tar.gz.

File metadata

  • Download URL: lotrpy-1.0.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for lotrpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4e95dd10a6054a00fb707ccad50830cfd6ab890558bf541943aa25c89edbb971
MD5 6717aa531a61501526fe02bd30955b7f
BLAKE2b-256 7f1b1f00bef0b61ba40ce1127d499a10d209870fb7135e395a6c9fa72ba6948c

See more details on using hashes here.

File details

Details for the file lotrpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lotrpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for lotrpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4656071a1fe7b6e48286712e54096cebc8c9c3b946f6c230b3e6093441e2c45f
MD5 fb94b0e96039b4732eb3a174767de375
BLAKE2b-256 2209320f1ef8e29daf83cee977353b294c6089e8b7476336da1347241a7d6163

See more details on using hashes here.

Supported by

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