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.4.tar.gz
(7.3 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.4.tar.gz.
File metadata
- Download URL: oneapi_sdk-0.0.4.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc15437acd3aef05fce226c15465a6b54e619dfe4628d7d9c3c6307147c5a2f9
|
|
| MD5 |
8bc23baca637e80ba71845f40affb3fd
|
|
| BLAKE2b-256 |
1d6f55a00fe1e425ab256587a475f6b03db921323ea7a6ae787d606fae175db7
|
File details
Details for the file oneapi_sdk-0.0.4-py3-none-any.whl.
File metadata
- Download URL: oneapi_sdk-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.9 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 |
157d50d5cbcd269b2dce4c81e096970dadf4bf017ee55a6f01fb6eb5c585258d
|
|
| MD5 |
0146d81d46f8f85556721d0cdf1662a3
|
|
| BLAKE2b-256 |
e947ee87b6625ee0866faa840e2040d7034ed6f86017e04e1f97184f63193a56
|