Skip to content

A simple API wrapper that generates images & facts of any animal

License

Notifications You must be signed in to change notification settings

animality-xyz/animality-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

animality-py

A simple API wrapper that generates images & facts of any animal

Installation

$ pip install animality-py

Simple Usage

import animality
from asyncio import get_event_loop

async def run():
    animal = await animality.get("dog")
    print(animal.name, animal.image, animal.fact)
    random = await animality.random()
    print(random.name, random.image, random.fact)

get_event_loop().run_until_complete(run())

Using a session

from animality import AnimalityClient
from asyncio import get_event_loop

async def run():
    animality = AnimalityClient()
    
    animal = await animality.get("dog")
    print(animal.name, animal.image, animal.fact)
    
    random = await animality.random()
    print(random.name, random.image, random.fact)

    await animality.close()

get_event_loop().run_until_complete(run())

Using the CLI

Get an animal.

$ animality cat

Get a random animal.

$ animality random

Get multiple animals.

$ animality cat dog panda bunny

About

A simple API wrapper that generates images & facts of any animal

Topics

Resources

License

Stars

Watchers

Forks

Languages