Giter VIP home page Giter VIP logo

data_science-memesgenerator's Introduction

Memes Generator

A multimedia application to dynamically generate quotes for supplied images. Accessed through CLI and a web interface (flask)

General Overview

  • The application interacts with a variety of complex filetypes. (PDF, Word Documents, CSVs, Text files). It implements a Strategy Pattern to offer flexibility of adding/editing new file types. link
  • it loads, manipulates, and saves images.
  • it integrates extracted text from the files with the images
  • it accepts dynamic user input through a command-line tool and a web service.

Project Scaffolding

The project is structured in two main modules MemeEngine and QuoteEngine and two main invoking programs api.py and meme.py to support web & CLI interfaces, respectively.

.
│   app.py                              # runs flask api
│   meme.py                             # runs modules from CMI
│   README.md                           # This file.
│
├───MemeEngine                          
│       MemeGenerator.py                # processes images and add text
│       __init__.py
│
├───QuoteEngine
│       CSVImporter.py                  # strategy: .csv reader
│       DocxImporter.py                 # strategy: .docx reader
│       Ingestor.py                     
│       IngestorInterface.py
│       PDFImporter.py                  # strategy: .pdf reader
│       QuoteModel.py
│       TXTImporter.py                  # strategy: .txt reader
│       __init__.py
│
├───templates                           # used for basic testing of web api.
│       base.html
│       meme.html
│       meme_form.html
│
└───_data                               # sample images and quotes in different file formats
    ├───DogQuotes
    │   │   DogQuotesCSV.csv
    │   │   DogQuotesDOCX.docx
    │   │   DogQuotesPDF.pdf
    │   │   DogQuotesTXT.txt
    │   │
    │   └───tmp
    ├───photos
    │   └───dog
    │           xander_1.jpg
    │           xander_2.jpg
    │           xander_3.jpg
    │           xander_4.jpg
    │
    └───SimpleLines
            SimpleLines.csv
            SimpleLines.docx
            SimpleLines.pdf
            SimpleLines.txt

Dependencies

for a complete list check requirements.txt

file types support

  • Python-docx
  • pdftotext
  • Pandas
  • Subprocess

Web Interface

  • flask
  • requests

Command Line Interface

  • Argparse
  • os

OOP and others

  • ABC
  • Typing
  • Pillow

Running the program

If optional arguments are not provided, the proram uses default values under _data folder and a random choice of file format.

Command Line Interface run python meme.py with optional arguments

  • --path : input path the image
  • --body : quote you would like to add
  • --author: author of the comment/quote

Flask Web Interface

  • run python api.py from the directory where the file is located
  • Simple web interface from templates folder is then accessed on port 5000 from localhost. http://127.0.0.1:5000

data_science-memesgenerator's People

Contributors

1ayham1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.