Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.49 KB

README.md

File metadata and controls

61 lines (46 loc) · 1.49 KB

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.