An API that can output anime girls, and is 100% manually verified
Project description
Random Image Fetcher
This Python module provides a function to fetch random images from an API based on specified tags and ratings. It supports filtering images by tags and ratings and allows for customization of the number of images requested.
Function: get_random_image
Description
Fetches a random image from the API that matches the specified tag(s) and/or rating(s).
Parameters
number
(int): The number of images to request. Default is1
. Must be 100 or fewer.tag
(Union[str, tuple, list], optional): A tag or a list of tags to filter images. IfNone
, no tag filtering is applied.rating
(Union[str, tuple, list], optional): A rating or a list of ratings to filter images. IfNone
, no rating filtering is applied.ignore
(bool, optional): IfFalse
and not enough images are found, a warning is printed. IfTrue
, no warning is printed. Default isFalse
.
Returns
- A list of URLs for the requested number of images. Returns an empty list if no images are found.
Example Usage
from your_module import get_random_image
Fetch 5 random images with tag "yuri" and rating "safe"
print(get_random_image(number=5, tag="yuri", rating="safe"))
Fetch 10 random images with tag "cute" without checking for rating
print(get_random_image(number=10, tag="cute"))
Fetch 3 random images with rating "explicit" and ignore the warning if not enough images are found
print(get_random_image(number=3, rating="explicit", ignore=True))
Error Handling
Raises a ValueError if number exceeds 100. Prints a warning message if the number of images requested cannot be fulfilled and ignore is False.
Dependencies
requests library: For making HTTP requests to the API.
Contact
For additional support or to request more images with specific tags, you may contact _.lex0 on Discord.
License
This project is licensed under the MIT License. See the terms of service & privacy policy located in the home page
Feel free to modify the content based on your specific project needs or preferences.
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
Built Distribution
File details
Details for the file animegirlapi-0.3.0.tar.gz
.
File metadata
- Download URL: animegirlapi-0.3.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59067695550c67d1ea37799b33cd3fcfed4849ee1fb0417a73bcab5e7b5d9351 |
|
MD5 | 9cd63ad84466b7894614bf4a1353d836 |
|
BLAKE2b-256 | 44254bdd0c0644f961982bd00b93b18668a2e7603b483d9e99d5531d285538e3 |
File details
Details for the file animegirlapi-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: animegirlapi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc19f3aa7b41a014babd31b3be4a906f6409bd27de6d7ee0b4cd5254a69b434 |
|
MD5 | 67a6ed5096683648c15c16f7499d2f94 |
|
BLAKE2b-256 | 8a19c6284492ef04966311161ea213250b4a558ac06eb6b2aa666d9ca4f8708d |