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.4.tar.gz (7.3 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for oneapi_sdk-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cc15437acd3aef05fce226c15465a6b54e619dfe4628d7d9c3c6307147c5a2f9
MD5 8bc23baca637e80ba71845f40affb3fd
BLAKE2b-256 1d6f55a00fe1e425ab256587a475f6b03db921323ea7a6ae787d606fae175db7

See more details on using hashes here.

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

Hashes for oneapi_sdk-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 157d50d5cbcd269b2dce4c81e096970dadf4bf017ee55a6f01fb6eb5c585258d
MD5 0146d81d46f8f85556721d0cdf1662a3
BLAKE2b-256 e947ee87b6625ee0866faa840e2040d7034ed6f86017e04e1f97184f63193a56

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