Modul/Command Line Tool to get dog images
Project description
random-dog
random-dog is a module for getting dog images, it uses dogAPI: https://dog.ceo/dog-api/ The module creation was inspired by random-cat module (https://github.com/gravmatt/random-cat)
Python 2 and 3 compatible
Installation
Install through pip.
$ pip install random-dog
or get from source
$ git clone https://github.com/Prasnal/random-dog
$ cd random-dog
$ python setup.py install
Usage
The dog module has just one function getDog() with two optional arguments.
Arguments
directory - default is the current directory
filename - default is a unique id
import dog
# dog.getDog(directory=None, filename=None)
dog.getDog(directory='/users/tor', filename='dog')
# /users/tor/dog.jpg
The function return the image name (absolute path if directory is specified) of the image.
Command Line
You can also request an image on the terminal.
$ randomdog [file]
# Example:
$ randomdog /users/tor/dog.jpg
The argument file is optional.
The command return the filename/absolute path of the image to the standard output (stdout).
Licence
The MIT License (MIT)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for random_dog-1.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed045578796636181dced30f7c7059748fe037099a07f6fb6500bfc648f0a05 |
|
MD5 | 5f95cf6b32e8fe812b763c16ce8e6c03 |
|
BLAKE2b-256 | b6ab8ccc1e2351a61d49e0ee2748ba41575c946fcccf63dfe5357d0c36d4847f |