Udacity Intermediate Python Nanodegree
Project 2
Mihaly Garamvolgyi
2022-09-27
Generate motivational memes that are images with quotes and author signatures.
User can supply their own image and quotes or can be generated randomly from the apps image and qoute directory.
Implementation is twofold: a CLI driven usage or through a web browser (Flask implementation)
- Go to directory
- Create venv
python -m venv venv
- Activate venv source
venv/bin/activate
or.\venv\Scripts\activate.bat
on Windows - Install requirements
pip install -r requirements.txt
- Python 3.10.5
- pdftotext CLI application
- required packages are listed in requirements.txt
- Flask
- web browser
Run the meme.py
with the following optional parameters:
path
- original imagebody
- qoute textauthor
- quote author
Export app as a FLASK_APP and navigate to the ip address with a browser.
- navigate to the project directory
- run
export FLASK_APP=app.py
orset FLASK_APP=app.py
on Windows - run
flask run --host 0.0.0.0 --port 3000 --reload
- Get the IP adress and port printed by Flask
- Access with a web browser
Module for ingesting qoutes from a number of different file types. Individual ingestors are developed for CSV, TXT, DOCX and PDF files and are packaged into an ingestor module.
Module for generating the memes. Uses python Pillow library for resizing and captioning images.