theoneapi


Nametheoneapi JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/raffykaloustian/raffy_kaloustian-SDK
SummaryThis SDK provides (partial) access to LibLab's Lord of the Rings API - The One API to rule them all.
upload_time2023-05-05 11:52:49
maintainer
docs_urlNone
authorRaffy Kaloustian
requires_python>=3.9
licenseMIT
keywords liblab sdk api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # raffy_kaloustian-SDK

This SDK provides (partial) access to [LibLab](https://liblab.com/)'s Lord of the Rings API - [The One API to rule them all](https://the-one-api.dev).

## Supported Python Version

This SDK supports Python 3.9 or higher.

## Installation

Install using pip from PyPi.

```shell
pip3 install theoneapi
```

## Example Usage

See examples.py.

```python
from theoneapi.client import Client
from theoneapi.query import Query

# sign up to get an access token: https://the-one-api.dev
client = Client('ACCESS_TOKEN')


'''
Movie Examples
'''

# get one movie (by id)
movie = client.movie.get_one('5cd95395de30eff6ebccde56')

# get all movies
movies = client.movie.get_all()

# get all movie quotes (by movie id)
# (see below for another way to get this as well)
movie_quotes_1 = client.movie.get_all_quotes('5cd95395de30eff6ebccde5b')


''' 
Quote Examples
'''

# get one quote (by id)
quote = client.quote.get_one('5cd96e05de30eff6ebcce92e')

# get all quotes
quotes = client.quote.get_all()

# get all movie quotes (by movie id)
# (see above for another way to get this as well)
movie_quotes_2 = client.quote.get_all_from_movie('5cd95395de30eff6ebccde5b')


'''
Query Option Examples
'''

query = Query()

# get paginated quotes
quotes_paginated = client.quote.get_all(
    query.paginate(offset=2, limit=3, page=1)
)

# get movies sorted ascending
movies_sorted = client.movie.get_all(
    query.sort_asc('name')
)

# get movies sorted ascending
movie_matched_name = client.movie.get_all(
    query.filter_match('name', 'The Two Towers')
)

# chaining query options
quotes_chained_query = client.quote.get_all(
    query.filter_match('movie', '5cd95395de30eff6ebccde5b').paginate(limit=5)
)
```

## Query Options

```python
from theoneapi.query import Query


query = Query()

# pagination
query.paginate(limit=limit, page=page, offset=offset)

# sorting
query.sort_asc(field)
query.sort_desc(field)

# filtering
query.filter_match(field, value)
query.filter_not_match(field, value)
query.filter_include(field, value)
query.filter_exclude(field, value)
query.filter_exists(field)
query.filter_not_exists(field)
query.filter_regex(field, value)
query.filter_not_regex(field, value)
query.filter_less_than(a, b)
query.filter_lt(a, b) # same as query.filter_less_than(a, b)
query.filter_greater_than(a, b)
query.filter_gt(a, b) # same as query.filter_greater_than(a, b)
query.filter_greater_than_equal_to(a, b)
query.filter_gte(a, b) # same as query.filter_greater_than_equal_to(a, b)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/raffykaloustian/raffy_kaloustian-SDK",
    "name": "theoneapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "liblab,sdk,api",
    "author": "Raffy Kaloustian",
    "author_email": "raffykaloustian@email.com",
    "download_url": "https://files.pythonhosted.org/packages/b1/e8/ef1ac86942e9fc270eced05b819c1e3a7e753d4947a29ef190cab5f576e8/theoneapi-0.0.1.tar.gz",
    "platform": null,
    "description": "# raffy_kaloustian-SDK\n\nThis SDK provides (partial) access to [LibLab](https://liblab.com/)'s Lord of the Rings API - [The One API to rule them all](https://the-one-api.dev).\n\n## Supported Python Version\n\nThis SDK supports Python 3.9 or higher.\n\n## Installation\n\nInstall using pip from PyPi.\n\n```shell\npip3 install theoneapi\n```\n\n## Example Usage\n\nSee examples.py.\n\n```python\nfrom theoneapi.client import Client\nfrom theoneapi.query import Query\n\n# sign up to get an access token: https://the-one-api.dev\nclient = Client('ACCESS_TOKEN')\n\n\n'''\nMovie Examples\n'''\n\n# get one movie (by id)\nmovie = client.movie.get_one('5cd95395de30eff6ebccde56')\n\n# get all movies\nmovies = client.movie.get_all()\n\n# get all movie quotes (by movie id)\n# (see below for another way to get this as well)\nmovie_quotes_1 = client.movie.get_all_quotes('5cd95395de30eff6ebccde5b')\n\n\n''' \nQuote Examples\n'''\n\n# get one quote (by id)\nquote = client.quote.get_one('5cd96e05de30eff6ebcce92e')\n\n# get all quotes\nquotes = client.quote.get_all()\n\n# get all movie quotes (by movie id)\n# (see above for another way to get this as well)\nmovie_quotes_2 = client.quote.get_all_from_movie('5cd95395de30eff6ebccde5b')\n\n\n'''\nQuery Option Examples\n'''\n\nquery = Query()\n\n# get paginated quotes\nquotes_paginated = client.quote.get_all(\n    query.paginate(offset=2, limit=3, page=1)\n)\n\n# get movies sorted ascending\nmovies_sorted = client.movie.get_all(\n    query.sort_asc('name')\n)\n\n# get movies sorted ascending\nmovie_matched_name = client.movie.get_all(\n    query.filter_match('name', 'The Two Towers')\n)\n\n# chaining query options\nquotes_chained_query = client.quote.get_all(\n    query.filter_match('movie', '5cd95395de30eff6ebccde5b').paginate(limit=5)\n)\n```\n\n## Query Options\n\n```python\nfrom theoneapi.query import Query\n\n\nquery = Query()\n\n# pagination\nquery.paginate(limit=limit, page=page, offset=offset)\n\n# sorting\nquery.sort_asc(field)\nquery.sort_desc(field)\n\n# filtering\nquery.filter_match(field, value)\nquery.filter_not_match(field, value)\nquery.filter_include(field, value)\nquery.filter_exclude(field, value)\nquery.filter_exists(field)\nquery.filter_not_exists(field)\nquery.filter_regex(field, value)\nquery.filter_not_regex(field, value)\nquery.filter_less_than(a, b)\nquery.filter_lt(a, b) # same as query.filter_less_than(a, b)\nquery.filter_greater_than(a, b)\nquery.filter_gt(a, b) # same as query.filter_greater_than(a, b)\nquery.filter_greater_than_equal_to(a, b)\nquery.filter_gte(a, b) # same as query.filter_greater_than_equal_to(a, b)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This SDK provides (partial) access to LibLab's Lord of the Rings API - The One API to rule them all.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/raffykaloustian/raffy_kaloustian-SDK"
    },
    "split_keywords": [
        "liblab",
        "sdk",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d654b7f0143173800c8b84cf258d97e6153a770ecb8d2b37392d202777ad6b18",
                "md5": "2e86ec54d5c503fdaa31ad388bf1db16",
                "sha256": "a457ddb3be07d14f8e891c0a54117a5bee93bc584e6cc1c38b4d385955564e16"
            },
            "downloads": -1,
            "filename": "theoneapi-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2e86ec54d5c503fdaa31ad388bf1db16",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5658,
            "upload_time": "2023-05-05T11:52:47",
            "upload_time_iso_8601": "2023-05-05T11:52:47.548264Z",
            "url": "https://files.pythonhosted.org/packages/d6/54/b7f0143173800c8b84cf258d97e6153a770ecb8d2b37392d202777ad6b18/theoneapi-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1e8ef1ac86942e9fc270eced05b819c1e3a7e753d4947a29ef190cab5f576e8",
                "md5": "52a71a7ef928969ee7334641ff69e4e4",
                "sha256": "4680af10e83cad71cb6b019ec860dd3a471929fd07f09e55ea2db513114e8edd"
            },
            "downloads": -1,
            "filename": "theoneapi-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "52a71a7ef928969ee7334641ff69e4e4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7007,
            "upload_time": "2023-05-05T11:52:49",
            "upload_time_iso_8601": "2023-05-05T11:52:49.278847Z",
            "url": "https://files.pythonhosted.org/packages/b1/e8/ef1ac86942e9fc270eced05b819c1e3a7e753d4947a29ef190cab5f576e8/theoneapi-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-05 11:52:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "raffykaloustian",
    "github_project": "raffy_kaloustian-SDK",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "theoneapi"
}
        
Elapsed time: 0.06143s