Skip to content

fastApi - poster-generator

A proof of concept for a poster generator accessible via api.

Live Demo

Check out the live demo

Example output

Here's a static image example of what the poster-generator API can generate:

poster

Here's an example of a live call and response from the poster-generator API. It might take a moment to load because the application needs to boot, as the API is only running on demand.

Request URL
https://fastapi-poster-generator.iknewt.com/poster?left_color_background=%230250C5&right_color_background=%23D4408C&left_color_foreground=%2300FFFF&right_color_foreground=%23FFFF00&left_url=https://iknewt.com/assets/otter-solid.png&right_url=https://iknewt.com/assets/otter-solid.png
Returns poster:

live-poster-example


Libraries tested

Library Usage
FastApi For api setup
Pillow For image editing

Run locally

git clone https://github.com/iKnewt/fastapi-poster-generator.git

Docker

everything you need should be in the makefile, run command

make

This will run:

docker build -t $(APP_NAME) .
docker run -p 5000:5000 $(APP_NAME)

Terminal

pip3 install  --no-deps -r requirements.txt

If running on MacOs

You might need to run the Install Certificates.command script, found in the Python folder, or else the api-calls might return error:

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)

Once the app is running

Docs, endpoints and examples can be found here: