A python wrapper for thecatapi.com
Project description
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(limit=1))
print(results[0].url)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
catapi.py-0.3.3.tar.gz
(7.9 kB
view details)
File details
Details for the file catapi.py-0.3.3.tar.gz
.
File metadata
- Download URL: catapi.py-0.3.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1380dc910b072bf197093c34117202fb52a347870f27d2abe0d59a863fc73783 |
|
MD5 | 37a04aebc00745ec039d66f353e017f9 |
|
BLAKE2b-256 | 2e24bc4d885cb7d8e0396d9385fceb1b95a4a420e838d50d41a443eec715816e |