An API that can output anime girls, and is 100% manually verified
Project description
AnimeGirlAPI
AnimeGirlAPI is a Python package designed for easy interaction with the CatGirlNexus API. It provides functionalities to fetch image details, download images, and access various tags and ratings.
Installation
To install AnimeGirlAPI, use Poetry
. Ensure you have Poetry
installed, then run:
poetry install
Usage
Functions
get_info(url)
Retrieves information about a specific image from the API.
Parameters:
url
(str): The URL of the image.
Returns:
- A dictionary with:
tags
: A dictionary of image tags (excluding "rating").rating
: The image's rating.
Example:
info = get_info("https://example.com/image1.jpg")
get_all_tags()
Gets a dictionary of all available tags with their descriptions.
Returns:
- A dictionary where:
- Keys are tag names.
- Values are descriptions of the tags.
Example:
tags = get_all_tags()
download_image(url, output=None)
Downloads an image from the specified URL and saves it to the given path.
Parameters:
url
(str): The URL of the image.output
(str, optional): The file path where the image will be saved. If not specified, the image is saved with its filename in the current directory.
Returns:
- A dictionary with:
path
: The path where the image was saved.
Example:
download_image("https://example.com/image1.jpg", "images/image1.jpg")
get_all_images()
Fetches and returns a dictionary of all images from the API.
Returns:
- A dictionary with all image URLs and their associated data.
Example:
images = get_all_images()
get_all_ratings()
Gets a list of all possible ratings.
Returns:
- A list of ratings, such as "suggestive", "nsfw", etc.
Example:
ratings = get_all_ratings()
get_random_image(number=1, tag=None, rating=None, ignore=False, randomize=False)
Fetches a random image that matches the given tags and/or ratings.
Parameters:
number
(int): Number of images to fetch (up to 100).tag
(str, tuple, list, optional): Tags to filter images by.rating
(str, tuple, list, optional): Ratings to filter images by.ignore
(bool, optional): Whether to ignore warnings if not enough images are found.randomize
(bool, optional): Whether to shuffle images before selection.
Returns:
- A list of image URLs matching the specified criteria.
Example:
random_images = get_random_image(number=5, tag=["catgirl"], rating="safe", randomize=True)
Requirements
- Python 3.6 or higher
requests
library
Development
To run tests, use:
poetry run pytest
License
This project is licensed under the MIT License.
Author
Allexx allexx129@gmail.com
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-1.5.1.tar.gz
.
File metadata
- Download URL: animegirlapi-1.5.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60a1eff055e6b8c45155318c1d9fa8aeae6697b5db4de2896b4a77b5b50cf296 |
|
MD5 | 7e8eaef12b292976753a180fa3ea980f |
|
BLAKE2b-256 | 2b69b561c7b6fc787afa070ed7b3236524851441be94d9c5e52d524504936e4b |
File details
Details for the file animegirlapi-1.5.1-py3-none-any.whl
.
File metadata
- Download URL: animegirlapi-1.5.1-py3-none-any.whl
- Upload date:
- Size: 4.8 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 | 8a3dbe3d41c5a3ac28882ffcf20789e7de90720b258039472c5fe700df2df9f3 |
|
MD5 | b597de11050dca0c9e74b8d5b5646cd4 |
|
BLAKE2b-256 | 4dde58815e536766c13f9c2f2f6a93063bb686b5e82b35b1d501d02ca74712c5 |