Skip to content

ephreal/catapi.py

Repository files navigation

Catapi.py

PyPI version info PyPI supported Python versions View code quality on Codacy Documentation Status

A python wrapper for TheCatAPI.com

Key Features

  • Asynchronous: Perfect for discord bots

Installing

Python 3.5.3 or higher is REQUIRED.

To install the library through pip

pip install catapi.py

Example usage

catapi.py is written asynchronously, which requires using asyncio. While this is convenient when running a discord bot, it requires a little more setup in a script.

import asyncio
import catapi

# Create the event loop where the code executes
loop = asyncio.new_event_loop()

# Initialize the api
api = catapi.CatApi(api_key="YOUR_API_KEY_HERE")

def run_coro(coroutine):
    return loop.run_until_complete(coroutine)


results = run_coro(api.search_images(limit=1))
print(results[0].url)

About

A python wrapper for TheCatAPI.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages