Skip to main content

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


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)

Uploaded Source

Built Distribution

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

oneapi_sdk-0.0.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

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

Hashes for oneapi_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f062567015f544927465ddc661170bc054df5d241cf7d37e8cc0c9817125b7aa
MD5 b5fc10a1c16465fd96620b95a4c84db8
BLAKE2b-256 d76dac5891220400ec3cca4b768bb016c126c9ab35c1461260bce58f3d40119b

See more details on using hashes here.

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

Hashes for oneapi_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b961c11cab80a49dadb03b26d716efa38830130cdfee76e82878c8624d2c137
MD5 992dcf615e90fcf3d9ad4902792b00e7
BLAKE2b-256 6c3dd539af0f3ad986b3428c013826890e067eebfc68a973f40f433c3ee8bc31

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