A multimedia command-line and web application to dynamically generate memes, which include an image with an overlaid quote and author name.
Use the package manager pip to install the required environment.
pip install -r requirements.txtYou will also need to install pdftotext
pip install pdftotextThe programme can be run via the command line or as a web application.
To start the application run app.py on flask:
$ python3 app.pyOnce running, you can access the application on the following virtual server: http://localhost:5000
To run the programme at the command line, invoke python3 meme.py. meme.py takes three optional command line arguments:
--paththe path for an image file--bodythe quote body as a string--authorthe author of the quote
The script returns a path to a generated image. If any argument is not defined, a random selection is used.
$ python3 meme.py --help
usage: meme.py [-h] [--path PATH] [--body BODY] [--author AUTHOR]The project consists of two modules: QuoteEngine and MemeEngine.
The QuoteEngine module is responsible for ingesting many types of files (pdf, txt, csv, and pdf) that contain quotes, consisting of the quote body and an author. The module consists of the IngestorInterface abstract base class; ingestor helper classes for each file type; the Ingestor class which selects the appropriate ingestor helper based on the file extension; and the QuoteModel, which encapsulates the body of the quote and the author.
The MemeEngine module is responsible for creating the memes by manipulating and drawing text onto images.