A wrapper for the xkcd API
Project description
xkcd-wrapper
A Python wrapper for the xkcd webcomic API.
Retrieves xkcd comic data and metadata as python objects.
Installation
At the command line, with pip
:
$ pip install xkcd-wrapper
Usage
>>> import xkcd_wrapper
>>> client = xkcd_wrapper.Client()
>>> latest_comic = client.get_latest() # Comic object containing data of the latest xkcd comic
>>> specific_comic = client.get(100) # Comic object with comic 100 data
>>> random_comic = client.get_random() # Comic object of a random comic
>>> specific_comic
xkcd_wrapper.Comic(100)
>>> specific_comic.image
'https://imgs.xkcd.com/comics/family_circus.jpg'
Documentation
Check the documentation for more details: https://xkcd-wrapper.readthedocs.io/en/latest
Ideas for the Future
- retrieve comic .jpeg
- async client
History
0.1.0 (23-04-2020)
- First release on PyPI
- Client and Comic classes
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
xkcd-wrapper-0.1.0.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for xkcd_wrapper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3771e9a6ff7b7584735663dfc3ceb841ac379201dc5d490bf034ce81b3173c4 |
|
MD5 | 84b5aa31d1a16df5c54aec656ae09a91 |
|
BLAKE2b-256 | a9a8e5dc8dc217ba32c551017d6c5b57eadd808e8d507bd5caffb442ed036793 |