Skip to main content

A wrapper for the xkcd API

Project description

xkcd-wrapper

python versions build status coverage docs status license

pypi pypi downloads

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)

Uploaded Source

Built Distribution

xkcd_wrapper-0.1.0-py3-none-any.whl (18.5 kB view hashes)

Uploaded Python 3

Supported by

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