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
Usage
To use the SDK, you will need to get an API key from The One API.
Basic usage:
```python
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.2.tar.gz
(7.2 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.2.tar.gz.
File metadata
- Download URL: oneapi_sdk-0.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffcb33377d39ae7795881946339217824cef9df305c5255f7da9de665c8ff450
|
|
| MD5 |
591d909c05be67534829bb8e80c1f1c1
|
|
| BLAKE2b-256 |
19756691b1542057af19fa46a9549ca1c3fc8a86179f615ec53066333ba50976
|
File details
Details for the file oneapi_sdk-0.0.2-py3-none-any.whl.
File metadata
- Download URL: oneapi_sdk-0.0.2-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 |
317df7668f172a3a0688b27fa31ec6a09b7842e4654fe3d8db2821c714dc4fd7
|
|
| MD5 |
e65ba1a439750acf3e0ff9b78fe4b6a1
|
|
| BLAKE2b-256 |
9627e6effc601d2edf66d23d923eed72eaf0c8324d8851aabdc703d2e05d41c9
|