Serverless image generator that uses XKCD comic as basis for _all_ excuses!
Clone or download
mislavcimpersak Merge pull request #27 from mislavcimpersak/hotfix/special_chars
no need to sanitize special chars that are also ascii chars
Latest commit 626dbb4 Dec 4, 2017

XKCD Excuse Generator

Generate your own excuse in a nifty comic style!

CircleCI Coverage Status

Go to and go from this:

to this:

using a simple form!

Originaly created as an example for Python Hrvatska meetup held on September 12, 2017 and for Python Belgrade meetup held on September 29, 2017 on which I gave a talk on serverless technology.

This repo is the backend part of the project. Code for the frontend part can be found in xkcd-excuse-front repo.

API Usage

If you are feeling extra wild you can use the API directly.

Send who, why and what with desired text as GET parameters to


You get the simplest api response in the world:

    data: {
        image_url: ""

Follow the given image_url value to get your excuse image.


Run with Python 3.6, created using Hug Framework, packaged with Zappa and served from AWS Lambda.

For frontend tech checkout the XKCD excuse front repo's README.


Since this is a side project that will obviously never make any money, costs should idealy be minimal. Everything is served behind CloudFlare CDN, even the API that is served from AWS Lambda through AWS API Gateway. Frontend is served on Github Pages.


Original image

Original image created by Randall Munroe from XKCD.

Released under Creative Commons Attribution-NonCommercial 2.5 License.


XKCD-Font created by iPython team.

Released under Creative Commons Attribution-NonCommercial 3.0 License.