A Python wrapper for the OtakuGIFs API
Project description
Expressipy - OtakuGIFs API Wrapper
A modern, fully-typed, async API wrapper for the OtakuGIFs API.
✨ Features
- 🔒 100% Type Safe - Full mypy compatibility with strict typing
- ⚡ Async/Await - Built with aiohttp for optimal performance
- 🎯 Intuitive API - Clean interface
- 🛡️ Error Handling - Comprehensive exception hierarchy
- 📝 Well Documented - Extensive docstrings and examples
🚀 Quick Start
Installation
pip install expressipy
Basic Usage
import asyncio
from expressipy import ExpressipyClient, ReactionType
async def main():
async with ExpressipyClient() as client:
# Get a random hug GIF
gif = await client.get_gif(ReactionType.HUG)
print(f"Hug GIF: {gif.url}")
# Get all available reactions
reactions = await client.get_all_reactions()
print(f"Available reactions: {len(reactions)}")
asyncio.run(main())
Quick One-Off Requests
from expressipy import ReactionType
from expressipy.utils import get_gif
# For simple one-off requests
gif = await get_gif(ReactionType.HUG)
print(f"Hug GIF: {gif.url}")
📖 Documentation
Supported Reactions
The wrapper supports all 66 reaction types from the OtakuGIFs API:
from expressipy import ReactionType
# All available as enum values:
ReactionType.HUG, ReactionType.DANCE,
ReactionType.CRY, ReactionType.LAUGH,
# ... and 60 more!
View all supported reactions
airkiss, angrystare, bite, bleh, blush, brofist, celebrate, cheers, clap, confused, cool, cry, cuddle, dance, drool, evillaugh, facepalm, handhold, happy, headbang, hug, huh, kiss, laugh, lick, love, mad, nervous, no, nom, nosebleed, nuzzle, nyah, pat, peek, pinch, poke, pout, punch, roll, run, sad, scared, shout, shrug, shy, sigh, sip, slap, sleep, slowclap, smack, smile, smug, sneeze, sorry, stare, stop, surprised, sweat, thumbsup, tickle, tired, wave, wink, woah, yawn, yay, yes
Type Safety
The wrapper provides excellent type safety with multiple input options:
# Using enum (most type-safe, IDE autocomplete)
gif = await client.get_gif(ReactionType.HAPPY)
# Using string literal (also type-safe)
gif = await client.get_gif("dance")
# Case insensitive
gif = await client.get_gif("SURPRISED")
Error Handling
from expressipy import ExpressipyException, HTTPException, NotFound
try:
gif = await client.get_gif("invalid_reaction")
except ValueError as e:
print(f"Invalid reaction: {e}")
except HTTPException as e:
print(f"API error {e.status}: {e}")
except ExpressipyException as e:
print(f"Something went wrong: {e}")
Advanced Usage
import asyncio
import logging
from expressipy import ExpressipyClient, setup_logging
# Enable debug logging to see HTTP requests
setup_logging(logging.DEBUG)
async def advanced_example():
# Custom timeout and manual lifecycle management
client = ExpressipyClient(timeout=30.0)
try:
# Get multiple GIFs efficiently with one client
reactions = [ReactionType.HUG, ReactionType.KISS, ReactionType.WAVE]
for reaction in reactions:
gif = await client.get_gif(reaction)
print(f"{reaction.value}: {gif.url}")
finally:
await client.close() # Always clean up!
asyncio.run(advanced_example())
🔧 Development
📋 Requirements
- Python 3.8+
- aiohttp >= 3.8.0
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- OtakuGIFs for providing the awesome API
📞 Support
- 📫 Create an issue on GitHub
- 📖 Read the documentation
If you enjoy this package, please consider giving it a ⭐ on GitHub!
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 expressipy-2.0.1.tar.gz.
File metadata
- Download URL: expressipy-2.0.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e503986dba8584cea2bea35a04a7037cee77cd9429957e095cf839b7a47d5da0
|
|
| MD5 |
24ecba0f1765789ea91957ba83eb1cae
|
|
| BLAKE2b-256 |
d86ee1c13afe09cd4a81c36048a7793003b623143aa8eba3b9cdeb78ef845176
|
File details
Details for the file expressipy-2.0.1-py3-none-any.whl.
File metadata
- Download URL: expressipy-2.0.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6521ed944ae5bdac69ccd8f7e502231342b93c57197a6d64f6cd2d561e317c6b
|
|
| MD5 |
36f3ebdff004cbcf8b9cf8f0bca2a5ba
|
|
| BLAKE2b-256 |
bd9acc1333982645e54d066882d745aa89ea2007035642699263ac831903fe73
|