Skip to main content

the_one_api_sdk is a Python client implemented most of the APIs for the-one-api.dev.

Project description

The One API Python SDK

Python SDK for "one API to rule them all".

Description

The one api serves your needs regarding data about The Lord of the Rings, the epic books by J. R. R. Tolkien and the official movie adaptions by Peter Jackson.

This is a Python developer friendly development kit for querying the one api.

Development

  1. Install poetry following: https://python-poetry.org/docs/
  2. Create the env
poetry install 

Build the whl package

poetry build

output in dist/

Publish to pipy

poetry publish

Testing

Run test with coverage report

poetry run pytest --cov

Integration testing

Integration tests requires access token to the one api and the module to be installed locally.

  1. first install theoneapisdk
  2. Set the env ONEAPI_SDK_ACCESS_TOKEN='YOUR_TOKEN'
  3. Run the integration tests from the package root folder
export ONEAPI_SDK_ACCESS_TOKEN=${access_token}; python -m pytest -v integration_tests

python code formatter

Using black code formatter: https://black.readthedocs.io/en/stable/

poetry run black .

Install

pip

  1. Install
python3 -m pip install TODO.

Usage

Init

Most of the api requires access_token you can set it with Env var ONEAPI_SDK_ACCESS_TOKEN= Or in the configuration

import theoneapisdk as oneapi
oneapi.config.access_token = "TOKEN"

Get Books

Books don't require access_token

from theoneapisdk as oneapi
import theoneapisdk.books as books

books.get_books()

Get Movies

Movies require access_token. If not provided

from theoneapisdk as oneapi
import theoneapisdk.movies as movies

movies = movies.get_movies()
quote = movies.quotes

Authors

Yair Rozenberg

License

This project is licensed under the Apache 2.0 LICENSE file for details

Acknowledgments

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

the_one_api_sdk-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

the_one_api_sdk-0.1.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file the_one_api_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: the_one_api_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b1 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2

File hashes

Hashes for the_one_api_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb7fbef5fcd6e5ff65096c7f62b761889700c9a13dcf708fc7a16640b3ac47e0
MD5 6831e1307042913b427fe804a90fc25a
BLAKE2b-256 dcf6386fafabf38b14f2af6b6dab89ff0202f436b2b66459508952d20d74ae33

See more details on using hashes here.

File details

Details for the file the_one_api_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: the_one_api_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b1 CPython/3.8.10 Linux/5.10.60.1-microsoft-standard-WSL2

File hashes

Hashes for the_one_api_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55193bfed3c48f53edcc87fb6b9dc74da22109dec472f1a7921fb4556057ae33
MD5 51a7dadb57ef2f4adb2348cb28beeac5
BLAKE2b-256 5700128596463667a7106a1ff498692e55116746eeec5691676d33a1260e4756

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