A Python SDK for The One API
Project description
Lord of the Rings SDK
This is a Python SDK for the Lord of the Rings API.
Installation
pip install oneapi-sdk
Usage
To use the SDK, you will need to get an API key from The One API.
Basic usage:
import oneapi
oneapi.access_token = "YOUR_API_KEY"
# Get all movies
movies = oneapi.Movie.list()
# Get all quotes from the first movie
quotes = movies[0].quotes
Filters:
import oneapi
# Filter syntax is {"field": ("operator", "value")}
# Operators are "=", "!=", "<", ">", ">=", "exists", "not_exists"
# Get all quotes from the first movie
quotes = oneapi.Quote.list(filter={"movie": ('=', '5cd95395de30eff6ebccde5c')})
Pagination:
import oneapi
# You can manually paginate through the results using .list(limit, offset)
quotes_1 = oneapi.Quote.list(limit=10, offset=0)
quotes_2 = oneapi.Quote.list(limit=10, offset=10)
# Or you can use the built-in pagination
quotes = oneapi.Quote.list(limit=10)
for quote in quotes.auto_paginate():
print(quote.dialog)
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
oneapi_sdk-0.0.3.tar.gz
(7.1 kB
view details)
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 oneapi_sdk-0.0.3.tar.gz.
File metadata
- Download URL: oneapi_sdk-0.0.3.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f062567015f544927465ddc661170bc054df5d241cf7d37e8cc0c9817125b7aa
|
|
| MD5 |
b5fc10a1c16465fd96620b95a4c84db8
|
|
| BLAKE2b-256 |
d76dac5891220400ec3cca4b768bb016c126c9ab35c1461260bce58f3d40119b
|
File details
Details for the file oneapi_sdk-0.0.3-py3-none-any.whl.
File metadata
- Download URL: oneapi_sdk-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b961c11cab80a49dadb03b26d716efa38830130cdfee76e82878c8624d2c137
|
|
| MD5 |
992dcf615e90fcf3d9ad4902792b00e7
|
|
| BLAKE2b-256 |
6c3dd539af0f3ad986b3428c013826890e067eebfc68a973f40f433c3ee8bc31
|