Lord of the rings sdk in Python
Project description
Lord of the rings sdk
SDK for Lord of the rings api
Setup
Install
pip install lord-of-the-rings-sdk
API Reference
Imports
from lord_of_the_rings_sdk import LordOfTheRings
# The first argument is the token
api = LordOfTheRings('your token')
Get items eg. books
# Returns requests.models.Response object
resp = api.book()
# Returns json object
resp.json()
# Status code
resp.status_code
Same thing book, movie, character, quote, chapter
Get single item eg. movie
# if the_id is specified it returns item with specified id
resp = api.movie(the_id="id of the item")
# Returns json object
resp.json()
Same thing book, movie, character, quote, chapter
Get single item attribute eg. single book chapter
# sends request to /book/{id}/chapter
resp = api.movie(the_id="id of the item", extra_path="chapter")
# Returns json object
resp.json()
Same thing book, movie, character, quote, chapter
Limit, Page, Offset
# limit by 20, offset by 1 and page 1 (by default a page is limited to 10)
resp = api.book(limit=20)
resp = api.book(page=1)
resp = api.book(offset=1)
# Returns json object
resp.json()
Sort
# syntax 'value to be sorted by:asc or desc' for ascending and descending order respectively
resp = api.character(sort='name:asc')
# Returns json object
resp.json()
Filter
| Option | Example | Example |
|---|---|---|
| match, negate match | match, negate match | name!=Frodo |
| include, exclude | race=Hobbit,Human | race!=Orc,Goblino |
| exists, doesn't exists | name | !name |
| regex | name=/foot/i | name!=/foot/i |
| less than, greater than or equal to | budgetInMillions<100 | academyAwardWins>0 |
# syntax value to be filtered. operation, value
resp = api.character(filter='race=Hobbit,Human')
# Returns json object
resp.json()
Tests
Clone the repo Github
run 'test/name of test'
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lord_of_the_rings_sdk-0.0.5.tar.gz.
File metadata
- Download URL: lord_of_the_rings_sdk-0.0.5.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1629086940f9d8933f4cdc1910a9d4f8364724893d6ed8d8217e278734ec60cf
|
|
| MD5 |
4d91b2bfcd0682beb8cc7b4d3032aacc
|
|
| BLAKE2b-256 |
645408549645a69a82e2881c7ce26b011ef4a0d34e3dafd07b6365d3fb78a245
|
File details
Details for the file lord_of_the_rings_sdk-0.0.5-py3-none-any.whl.
File metadata
- Download URL: lord_of_the_rings_sdk-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f7428fe21ededc6826161d9ef4865766d872b8b8025ced0f837cfd0e0955eed
|
|
| MD5 |
6d0b39701659d6272c1b160d6b5858df
|
|
| BLAKE2b-256 |
0403f62cf265c44c7a3983f54a6e8b5da7a135c6d474b1ac04dd8e33944e037e
|