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 KawaiiClient
client = KawaiiClient(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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file kawaiired-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: kawaiired-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da6307832a68fe47291355e7210c991ec2845fdd12a3ca059fef83c2fb34fa2e |
|
MD5 | dc21ad500d7548f51e563032aef667f3 |
|
BLAKE2b-256 | 5ff00b798c793e447f6ce66e726f549c2746975967c266dcec2861cd8f64acd5 |