Skip to main content

A python wrapper for thecatapi.com

Project description

PyPI version info PyPI supported Python versions

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


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.2.0-a.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file catapi.py-0.2.0-a.tar.gz.

File metadata

  • Download URL: catapi.py-0.2.0-a.tar.gz
  • Upload date:
  • Size: 7.0 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

Hashes for catapi.py-0.2.0-a.tar.gz
Algorithm Hash digest
SHA256 a2e69d2c6f55206284c01e3b93bd7eff8bdb5cc6c20279c5c6f93f37e5e9f0dc
MD5 de4642a9c2c94e61e937c3dcf5d37224
BLAKE2b-256 cd2cf4538e0de7f5345df1a35db7a23e4c2de8d4749e8f43b11f7789970e7692

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