Python wrapper for the AnimePixels API
Project description
AnimePixels-API Python SDK
A simple NPM wrapper for the [AnimePixels API]. Fetch anime images & GIFs by category, ID, randomly, or search — in one line. Works cross-platform (Node.js, React, Next.js, python etc.).
🚀 Installation
pip install animepixels
from animepixels import AnimePixels
# Initialize the API client
api = AnimePixels(base_url="https://animepixels-api.vercel.app/api/media")
# -------------------------------
# Random Image
# -------------------------------
print("🖼️ Random Image:")
random_img = api.images.random()
print(random_img, "\n")
# -------------------------------
# Random Image by Category
# -------------------------------
print("🎯 Random Naruto Image:")
naruto_img = api.images.random("naruto")
print(naruto_img, "\n")
# -------------------------------
# Get Image by ID
# -------------------------------
print("🆔 Get Image by ID:")
image_by_id = api.images.by_id("123abc") # Replace with valid ID
print(image_by_id, "\n")
# -------------------------------
# Get Images by Category
# -------------------------------
print("📂 Images from 'onepiece' category:")
onepiece_imgs = api.images.by_category("onepiece", limit=3)
for img in onepiece_imgs:
print(img["url"])
print()
# -------------------------------
# Search Images
# -------------------------------
print("🔍 Search for 'itachi' images:")
search_results = api.images.search("itachi", limit=3)
for r in search_results:
print(r["url"])
print()
# -------------------------------
# Random GIF
# -------------------------------
print("🎞️ Random GIF:")
random_gif = api.gifs.random()
print(random_gif, "\n")
# -------------------------------
# Random GIF by Category
# -------------------------------
print("🎬 Random 'naruto' GIF:")
naruto_gif = api.gifs.random("naruto")
print(naruto_gif, "\n")
# -------------------------------
# Get GIF by ID
# -------------------------------
print("🆔 Get GIF by ID:")
gif_by_id = api.gifs.by_id("abc123") # Replace with valid ID
print(gif_by_id, "\n")
# -------------------------------
# Get GIFs by Category
# -------------------------------
print("📁 GIFs from 'attack-on-titan' category:")
aot_gifs = api.gifs.by_category("attack-on-titan", limit=3)
for gif in aot_gifs:
print(gif["url"])
print()
# -------------------------------
# Search GIFs
# -------------------------------
print("🔍 Search for 'luffy' GIFs:")
search_gifs = api.gifs.search("luffy", limit=3)
for g in search_gifs:
print(g["url"])
print()
# -------------------------------
# Get All Categories
# -------------------------------
print("📚 Available Categories:")
categories = api.categories.all()
print(categories)
print("\n✅ Done! All features tested successfully.")
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
animepixels-2.0.1.tar.gz
(3.5 kB
view details)
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 animepixels-2.0.1.tar.gz.
File metadata
- Download URL: animepixels-2.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef0c11b59315363e9074787842dcb44203f30220234e7652c1a32c96e345ab08
|
|
| MD5 |
06e1928e04920f541aee369bcb166658
|
|
| BLAKE2b-256 |
ae1ab01a545e23a9f9a9679a6d982be33cd7162f030edd9fdf4e75bf0e9fdbd6
|
File details
Details for the file animepixels-2.0.1-py3-none-any.whl.
File metadata
- Download URL: animepixels-2.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f989fbd4549b4b9277e52ce8ddebed02f808e76804a038619797e72d1297bbf1
|
|
| MD5 |
015f4bac9e23b166dbebb0e9cb72f045
|
|
| BLAKE2b-256 |
89d14f8b68391d00900aed751aee840e2b125ab253eab13ba4e619cdb2761f29
|