Skip to main content

A Python wrapper for the OtakuGIFs API

Project description

Expressipy - OtakuGIFs API Wrapper

PyPI version Python 3.8+ License: MIT

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

📞 Support


If you enjoy this package, please consider giving it a ⭐ on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expressipy-2.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

expressipy-2.0.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for expressipy-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e503986dba8584cea2bea35a04a7037cee77cd9429957e095cf839b7a47d5da0
MD5 24ecba0f1765789ea91957ba83eb1cae
BLAKE2b-256 d86ee1c13afe09cd4a81c36048a7793003b623143aa8eba3b9cdeb78ef845176

See more details on using hashes here.

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

Hashes for expressipy-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6521ed944ae5bdac69ccd8f7e502231342b93c57197a6d64f6cd2d561e317c6b
MD5 36f3ebdff004cbcf8b9cf8f0bca2a5ba
BLAKE2b-256 bd9acc1333982645e54d066882d745aa89ea2007035642699263ac831903fe73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page