Skip to main content

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

animegirlapi-1.6.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

animegirlapi-1.6.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file animegirlapi-1.6.0.tar.gz.

File metadata

  • Download URL: animegirlapi-1.6.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for animegirlapi-1.6.0.tar.gz
Algorithm Hash digest
SHA256 7d509b1e066b822041037744f0c12ca7038f9d4bff8abd4d4bf5064f2fe57a54
MD5 1351ce63738d77092a28a1410f970b8f
BLAKE2b-256 1a39b8808e9de1b2ed34cfc7c9ff93b9a8b081a1b8668046bdd211e2a9af84a8

See more details on using hashes here.

File details

Details for the file animegirlapi-1.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for animegirlapi-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb09415dc66f64b75eee59f40eca688a1ba29cffe740a8ddce1b9b4f23cf7d16
MD5 fac3fb15e8f22d438b61cff53f1bf91c
BLAKE2b-256 697d57b4492a61675b6391dde6237ca660a388736f6e3f4a6ef608e2245baf0f

See more details on using hashes here.

Supported by

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