Skip to main content

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

Project description

animalapi

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


<img src="https://img.shields.io/pypi/v/animalapi.svg" alt="PyPI version" />
<img src="https://img.shields.io/github/license/dashutosh04/animalapi.svg" alt="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.

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

animalapi-0.0.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

animalapi-0.0.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file animalapi-0.0.4.tar.gz.

File metadata

  • Download URL: animalapi-0.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for animalapi-0.0.4.tar.gz
Algorithm Hash digest
SHA256 32bc81b7d00e5ee71ec8668e9c5a45e97cf98063972b697760980c567904d181
MD5 361c79d9f978bf0d995276abaa550302
BLAKE2b-256 884d3e188e6e354441685394131f73ef096237343405eb24d73246311893dc2b

See more details on using hashes here.

File details

Details for the file animalapi-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: animalapi-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for animalapi-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 21a306a9d08c003619b091d4821726b9063d981a28aaf6765cb3667e848ae47d
MD5 ae0bd183e8600300b77cefa191518a38
BLAKE2b-256 e09df3c3c3e2cccd690daa64c6d48059bbed5fe219b7fb0d289421b9f8be213c

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