Skip to main content

kawaiired-py

A Python wrapper for the kawaii.red API.

Table of Contents

Installation

Install from pypi

pip install kawaiired-py

Install from source

pip install git+https://github.com/keksiqc/kawaiired-py

Getting started

To use this wrapper, you'll need an API token from kawaii.red. Visit their website to obtain a token.

Usage

Synchronous

from kawaiired import KawaiiClient

client = KawaiiClient(token="your_token_here")

client.endpoints("gif")
# ['hug', 'kiss', 'pat', 'slap', 'tickle', 'waifu', 'wink', 'yiff']

client.get("gif", "kiss")
# https://api.kawaii.red/gif/kiss/kiss1.gif

client.random("gif")
# https://api.kawaii.red/gif/pat/pat1.gif

client.gif("kiss")
# https://api.kawaii.red/gif/kiss/kiss1.gif

stats = client.stats()
# <Stats>

Asynchronous

from kawaiired import KawaiiAioClient

client = KawaiiAioClient(token="your_token_here")

await client.endpoints("gif")
# ['hug', 'kiss', 'pat', 'slap', 'tickle', 'waifu', 'wink', 'yiff']

await client.get("gif", "kiss")
# https://api.kawaii.red/gif/kiss/kiss1.gif

await client.random("gif")
# https://api.kawaii.red/gif/pat/pat1.gif

await client.gif("kiss")
# https://api.kawaii.red/gif/kiss/kiss1.gif

stats = await client.stats()
# <Stats>

Stats

The stats() method returns a Stats object with the following attributes:

stats.endpoints         # List of available endpoints
stats.all               # Total number of requests
stats.failed            # Number of failed requests
stats.history           # List of recent requests
stats.most_endpoint     # Most used endpoint
stats.most_endpoints    # List of most used endpoints
stats.most_type         # Most used type (e.g., 'gif')
stats.most_types        # List of most used types

Contributing

Contributions to this project are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a new branch for your changes
  3. Make your changes and commit them with a clear description
  4. Open a pull request with a detailed explanation of your changes

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Release files for kawaiired 1.0.1

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

Source distribution (sdist)

Source distribution for kawaiired 1.0.1
File Size Uploaded
kawaiired-1.0.1.tar.gz 10.9 kB Details

Built distribution (wheel)

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

Total release size: 17.5 kB

Release files / kawaiired-1.0.1.tar.gz

Download URL kawaiired-1.0.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d96841e7e7c9f44273ec9578717488dd9900e550c01dc95ffeee5494320c06f7
BLAKE2b-256 checksum
How to use checksums
1ed5917b6493c9315891a6748713e8f8b04aad355bc259c94d20e5bc6162ce53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.24

Release files / kawaiired-1.0.1-py3-none-any.whl

Download URL kawaiired-1.0.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85be5f96cd58a29f5fc023832a57d19be4796e977ab1c9e787e5f9308d86cc84
BLAKE2b-256 checksum
How to use checksums
9bfd356147fe1d82f5009fac9aba2aba0b192a840edcbaa900f343e6b26f3103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.24

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

1 release file

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