Code Monkey home page Code Monkey logo

giffer's People

Contributors

gitlost-murali avatar srmsoumya avatar

Watchers

 avatar  avatar  avatar

giffer's Issues

Refactor v0

Refactor to use google sheet, and reducing hard coded variables.

import pandas as pd
url = 'https://docs.google.com/spreadsheets/d/{key}/export?format=csv&gid={gid}'
df = pd.read_csv(url.format(key='1qYVSVN3WLMha8J9wofdADxbX0USFJ1l-Yc5M1EfjIC8', gid='166461608'))
dff = df.iloc[1:].set_index('language')

setup fonts from https://github.com/saiswa/free-fonts
part-2

def make_content(lang):
    TL = dff[lang]
    return {
        "27": {
            'captions': [
                {'caption': wrapper(TL.T1), 'point': (475, 300), 'fill': (0,0,0), 'font_size': 100}
        ]},
        "29": {
            'captions': [
                {'caption': wrapper(TL.T2), 'point': (190, 100), 'fill': (0,0,0), 'font_size': 30}  
        ]},
        "30": {
            'captions': [
                {'caption': wrapper(TL.T2), 'point': (190, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T3), 'point': (525, 100), 'fill': (0,0,0), 'font_size': 30}
        ]},
        "31": {
            'captions': [
                {'caption': wrapper(TL.T3), 'point': (190, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T3), 'point': (525, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T4), 'point': (415, 570), 'fill': (0,0,0), 'font_size': 30}
        ]},
        "32": {
            'captions': [
                {'caption': wrapper(TL.T2), 'point': (190, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T3), 'point': (525, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T4), 'point': (415, 570), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T5), 'point': (820, 640), 'fill': (0,0,0), 'font_size': 30}
        ]},
        "33": {
            'captions': [
                {'caption': wrapper(TL.T2), 'point': (190, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T3), 'point': (525, 100), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T4), 'point': (415, 570), 'fill': (0,0,0), 'font_size': 30},
                {'caption': wrapper(TL.T5), 'point': (820, 640), 'fill': (0,0,0), 'font_size': 30}
        ]},
    }

langs = ['hindi', 'telugu', 'kannada', 'tamil', 'malayalam', 'odiya', 'gujarati', 'punjabi', 'bengali']
for lang in langs:
    # get fonts from https://github.com/saiswa/free-fonts
    FONT = {'family': DATA/'fonts'/'indic'/f'Lohit {lang.title()}, Regular.ttf'}
    print(f'Creating {lang}.gif')
    giffer(DATA/'distance.gif', make_content(lang), FONT, f'{lang}.gif')

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.