Skip to main content

A simple python wrapper for using API of https://thecatapi.com/

Project description

PyMeow

The simple way to get cats 🐱

About

This is a simple python wrapper for using API of https://thecatapi.com/. By this module you can get images of cats🐱 or information of their breeds. You can see examples in the examples folder. All entities are represented as dataclasses. API have more than 60k images, breeds and facts about cats. I recommend to sign up and get API key, its free and this removes most of the restrictions and limits.

Development

pymeow is being actively developed, and new API changes should arrive on pymeow very quickly. pymeow uses requests and dataclasses as models for its methods. In the future, I will add async version of this wrapper.

Installation

PyPi page pymeow requires python 3.7 or higher. This module can be installed by pip:

pip install pymeow

Usage

from pymeow import Client


client = Client(api_key='your_api_key')
random_cat = client.get_cat(has_breeds=True)  # get random cat with breads(requires api key)

print(random_cat)
# >>> Cat(image_info=CatPic(id='fsEMVl7f5', url='https://cdn2.thecatapi.com/images/fsEMVl7f5.jpg', width=1080, height=1080), breed_info=Breed(weight={'imperial': '8 - 20', 'metric': '4 - 9'}, id='raga', name='Ragamuffin', cfa_url='http://cfa.org/Breeds/BreedsKthruR/Ragamuffin.aspx', vetstreet_url='http://www.vetstreet.com/cats/ragamuffin', vcahospitals_url='https://vcahospitals.com/know-your-pet/cat-breeds/ragamuffin', temperament='Affectionate, Friendly, Gentle, Calm', origin='United States', country_codes='US', country_code='US', description='The Ragamuffin is calm, even tempered and gets along well with all family members. Changes in routine generally do not upset her. She is an ideal companion for those in apartments, and with children due to her patient nature.', life_span='12 - 16', indoor=0, lap=1, alt_names='', adaptability=5, affection_level=5, child_friendly=4, dog_friendly=5, energy_level=3, grooming=3, health_issues=3, intelligence=5, shedding_level=3, social_needs=3, stranger_friendly=5, vocalisation=1, experimental=0, hairless=0, natural=0, rare=0, rex=0, suppressed_tail=0, short_legs=0, wikipedia_url='https://en.wikipedia.org/wiki/Ragamuffin_cat', hypoallergenic=0, reference_image_id='SMuZx-bFM'))

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

pymeow-1.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyMeow-1.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pymeow-1.0.1.tar.gz.

File metadata

  • Download URL: pymeow-1.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for pymeow-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35302f106afb65fed142dc319408fbcab5829e84159747dc7f64ab5a68a2d80f
MD5 3199e9f8927053921775e219e5ac0024
BLAKE2b-256 4ce036dac609264dadc2a206adba42b515465965a10c80b416f27ed400704ecf

See more details on using hashes here.

File details

Details for the file PyMeow-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: PyMeow-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for PyMeow-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f5656efea1f84f9b3c5b8901fff057392d8a71e58004a137212ffc72422354
MD5 a28c3b88049efcf243ffef40001c6a1b
BLAKE2b-256 8acdeb72c96129328c252ab58bacfc7fedd1cef441e473f4742adb2115c5ffa5

See more details on using hashes here.

Supported by

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