Skip to main content

FindaCat API Wrapper

A lightweight Python wrapper for the finda.cat API, providing easy access to cat images and related data.

Features

  • Get random cat images with customizable options (format, blur, saturation, text, etc.)
  • Retrieve API statistics
  • Get all available cat image IDs
  • Access the history of cat images in Base64 format

Installation

  • Python 3.7 or higher
pip install findacat

Usage

from findacat import FindaCat, CatOptions

client = FindaCat()
opts = CatOptions(format="png", blur=1)

# Get a random cat image with options
image_bytes = client.get_cat_image(opts)

with open("cat.png", "wb") as f:
    f.write(image_bytes)

# Get API statistics (JSON)
stats = client.get_stats()
print(stats)

# Get all cat image IDs (JSON)
all_images = client.get_all_images()
print(all_images)

# Get Base64 cat images history (JSON)
history = client.get_history()
print(history)

Notes

  • The get_cat_image method returns the image content as bytes.
  • Other methods return JSON responses from the API.
  • Use CatOptions to customize the image request parameters.
  • Errors from the API are raised as exceptions for image requests, or returned as JSON with an "error" key for data requests.

Metadata

Release files for findacat 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for findacat 1.0.0
File Size Uploaded
findacat-1.0.0.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for findacat 1.0.0
File Interpreter ABI Platform
findacat-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.2 kB

Release files / findacat-1.0.0.tar.gz

Download URL findacat-1.0.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7b376fe605865d9f4f5d6543a1dca7daada61508f7d02ac4376e8122e2efaf4a
BLAKE2b-256 checksum
How to use checksums
a46ad47959e65a889c1b3aef0d3a4e95ab81664ebd48ea9938d4199abf4fcde2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / findacat-1.0.0-py3-none-any.whl

Download URL findacat-1.0.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bed988c7ea8d302b1f7c8bedff9895d128c3a74cfd263108f9a06090795a4f8
BLAKE2b-256 checksum
How to use checksums
b59f07cd7ebb1c52a412c585c542770b57e3cd91d4493b419e114c62280fa394
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page