Skip to content

This is a simple Python wrapper for the some-random-api.ml API, allowing you to easily access animal images and facts in your Python projects. It provides functions to retrieve random animal data (image and fact) or data for a specific animal (like dog, cat, panda, etc.).

License

Notifications You must be signed in to change notification settings

dashutosh04/animalapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

animalapi

A simple Python wrapper for the some-random-api.ml API.
PyPI version License

Easily access animal images and facts in your Python projects.

Features

  • Random Animal Data: Get randomized animal data (image and fact) with rand_animals().
  • Specific Animal Data: Fetch data for a specific animal using animal_data(animal_name).
  • Supported Animals: Currently supports "dog", "cat", "bird" and "koala".
  • Error Handling: Provides informative error messages and handles invalid animal names and API request errors.

Installation

pip install animalapi

Usage

Get random animal data

import animalapi as a

data = a.rand_animals()
img = data["image"]
fact = data["fact"]

print(img) 
print(fact) 

Get data for a specific animal

import animalapi as a

data = a.animal_data("dog")
img = data["image"]
fact = data["fact"]

print(img)
print(fact)

Contributing

Contributions are welcome! Feel free to open issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This is a simple Python wrapper for the some-random-api.ml API, allowing you to easily access animal images and facts in your Python projects. It provides functions to retrieve random animal data (image and fact) or data for a specific animal (like dog, cat, panda, etc.).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages