A Python wrapper for the kawaii.red API.
Project description
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:
- Fork the repository
- Create a new branch for your changes
- Make your changes and commit them with a clear description
- 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kawaiired-1.0.1.tar.gz.
File metadata
- Download URL: kawaiired-1.0.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d96841e7e7c9f44273ec9578717488dd9900e550c01dc95ffeee5494320c06f7
|
|
| MD5 |
b966032d80c0e3e69eeb74fce2323fb4
|
|
| BLAKE2b-256 |
1ed5917b6493c9315891a6748713e8f8b04aad355bc259c94d20e5bc6162ce53
|
File details
Details for the file kawaiired-1.0.1-py3-none-any.whl.
File metadata
- Download URL: kawaiired-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85be5f96cd58a29f5fc023832a57d19be4796e977ab1c9e787e5f9308d86cc84
|
|
| MD5 |
7a2278be2fd49fca30951154251ad72b
|
|
| BLAKE2b-256 |
9bfd356147fe1d82f5009fac9aba2aba0b192a840edcbaa900f343e6b26f3103
|