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.1.0.tar.gz (14.0 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.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file expressipy-2.1.0.tar.gz.

File metadata

  • Download URL: expressipy-2.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for expressipy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 28faad8093dc7ac7c5936bf9eba7ac6dccc9c5285c9e0187457f3d4a80736df9
MD5 dec88f9ba9bf2ce227fcb3c2532855eb
BLAKE2b-256 22d2792dd16c1c38544887476b1b8866c144d7eaa151aa96066ba7c880d0717f

See more details on using hashes here.

File details

Details for the file expressipy-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: expressipy-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f938805803df5dfceba58f0806f5d6b966b4d8a9dae5ddb5a2f54a0067ce34fb
MD5 e78af6b820641def66dc0da34c2d865f
BLAKE2b-256 11992b6a02e6f013e639cdc11149786d405251504cfafc73830c219f7222e839

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