Skip to main content

Unofficial python client for the Rooster Teeth api

Project description

https://travis-ci.org/NickMolloy/rt_api.svg?branch=master Documentation Status https://badge.fury.io/py/rt-api.svg

rt_api

rt_api is a python client for the Rooster Teeth Api. It allows easy access to resources such as episodes, seasons, shows, and users.

It supports Python 2.7, 3.4-3.7, as well as PyPy.

Installation

To install rt_api, run:

pip install rt_api

Alternatively rt_api can be installed from source by cloning the repository and running setuptools:

git clone https://github.com/NickMolloy/rt_api
cd rt_api
python setup.py install

Using rt_api

The main entry point for the library is the Api class. Instantiating this class will give access to all of the API functionality. For example:

from rt_api.api import Api

api = Api()  # Instantiate api. Generates default access token.
latest_episodes = api.episodes()  # Get an iterable of the latest episodes
newest_episode = next(latest_episodes)
print(newest_episode.title)  # Print out episode title
show = newest_episode.show  # Get a reference to the show the episode is from
print(show.name)  # Print out name of the show

If you want to be able to perform actions as a specific user, you must first authenticate:

from rt_api.api import Api

api = Api()
api.authenticate("myUsername", "myPassword")  # Authenticate as myUsername

From this point, all actions performed will be done in the context of that user. For instance, the current user is available through the me attribute of the api:

my_user = api.me  # Get the user object associated with the authenticated user
my_user.queue  # Get the current user's episode watch list

For more information on the available actions, see the package documentation, or some examples.

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

rt_api-1.1.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

rt_api-1.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file rt_api-1.1.1.tar.gz.

File metadata

  • Download URL: rt_api-1.1.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rt_api-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2b845922bcd8c7da770ff2f5b43c81ba975818dcf5cd1319064c74d90f986df3
MD5 76927a8c655bb9a2d4d5764001128c75
BLAKE2b-256 04dd3846a54e08064d3a305883a09e36973ab3de055788c8d33db18f7e44bfae

See more details on using hashes here.

File details

Details for the file rt_api-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rt_api-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e44400f66c6f08f885b4360f786c92361c86eb96573852f3d2c0821f99375b3
MD5 bf01e945e00e268d3774b6d0ea3d080a
BLAKE2b-256 17ea9aab59a8372de6045d03d872f26b6f4e145ec43dbd993980c4f672e18010

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page