Skip to main content

🐶 DogCEOPy

A lightweight, modern Python wrapper for the Dog CEO API.

PyPI version Python versions License

DogCEOPy provides a simple and Pythonic interface for retrieving dog breeds, sub-breeds, and dog images without dealing with raw HTTP requests.

Features

  • 🚀 Simple and intuitive API
  • 🐕 Fetch all dog breeds
  • 🦴 Fetch sub-breeds
  • 🖼️ Get random dog images
  • 📷 Get multiple random images
  • 🐶 Get breed and sub-breed images
  • 📝 Fully type hinted
  • 🔄 Context manager support
  • ⚡ Lightweight with minimal dependencies

Installation

pip install DogCEOPy

Quick Start

from dogceopy import DogCEO

dog = DogCEO()

print(dog.random.image())

Example output:

https://images.dog.ceo/breeds/husky/n02110185_14597.jpg

Breed Information

List all breeds

from dogceopy import DogCEO

dog = DogCEO()

print(dog.breeds.list())

List all breeds with sub-breeds

print(dog.breeds.list_all())

List sub-breeds

print(
    dog.breeds.sub_breeds("bulldog")
)

Output:

["boston", "english", "french"]

Check if a breed exists

print(
    dog.breeds.exists("husky")
)

Output:

True

Random Images

One random dog image

print(
    dog.random.image()
)

Multiple random dog images

print(
    dog.random.images(5)
)

Breed Images

Random Husky image

print(
    dog.images.random("husky")
)

Five random Husky images

print(
    dog.images.random_many(
        "husky",
        5
    )
)

All Husky images

print(
    dog.images.all("husky")
)

Sub-Breed Images

English Bulldog is a sub-breed of Bulldog.

Random English Bulldog image

print(
    dog.images.sub_random(
        "bulldog",
        "english"
    )
)

Five random English Bulldog images

print(
    dog.images.sub_random_many(
        "bulldog",
        "english",
        5
    )
)

All English Bulldog images

print(
    dog.images.sub_all(
        "bulldog",
        "english"
    )
)

Using a Context Manager

from dogceopy import DogCEO

with DogCEO() as dog:
    print(
        dog.random.image()
    )

The HTTP session is automatically closed when the block exits.


API Overview

random

Method Description
image() Get one random dog image
images(count) Get multiple random dog images

breeds

Method Description
list() List all breeds
list_all() List all breeds and sub-breeds
sub_breeds(breed) Get sub-breeds
exists(breed) Check whether a breed exists
has_sub_breeds(breed) Check whether a breed has sub-breeds

images

Method Description
random(breed) Random image for a breed
random_many(breed, count) Multiple random images
all(breed) All images for a breed
sub_random(breed, sub_breed) Random image for a sub-breed
sub_random_many(breed, sub_breed, count) Multiple random images for a sub-breed
sub_all(breed, sub_breed) All images for a sub-breed

Requirements

  • Python 3.8+
  • requests

Running Tests

pytest

Author

Developed and maintained by JackMa

GitHub: https://github.com/Fmasterpro27


License

Licensed under the Apache License 2.0.


Acknowledgements

This library is an unofficial Python wrapper for the Dog CEO API and is not affiliated with Dog CEO.

Powered by the Dog CEO Dog API.

Metadata

Release files for DogCEOPy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DogCEOPy 1.0.0
File Size Uploaded Provenance Actions
dogceopy-1.0.0.tar.gz 10.0 kB Without provenance Details for dogceopy-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for DogCEOPy 1.0.0
File Interpreter ABI Platform Actions
dogceopy-1.0.0-py3-none-any.whl Python 3 none any Details for dogceopy-1.0.0-py3-none-any.whl

Total release size: 21.0 kB

Release files / dogceopy-1.0.0.tar.gz

Download URL dogceopy-1.0.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6039cffd58622a20d76901ba34bbb3540cf4ba63caa30fa107496b340f5c986b
BLAKE2b-256 checksum
How to use checksums
361106d5267d929d27acbe374324fa2bcb5a81a1149a555dda7ddfbac4ad14e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / dogceopy-1.0.0-py3-none-any.whl

Download URL dogceopy-1.0.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3889071efd17c2c1bce23ea105e42369faa9178b7b2f8dfd42cd15aca47bdfe5
BLAKE2b-256 checksum
How to use checksums
21a64724f70c0c5577b706666655475d8d690fa6d5291b806c13daf53deb8019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for DogCEOPy 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page