GithubHelp home page GithubHelp logo

autopptx's Introduction

AutoPPTX

AutoPPTX is a wrapper based on python-pptx(https://python-pptx.readthedocs.io/en/latest/).
The package provides an interface that allows user to create presentation with python-pptx more easily.

I. Modules

Since the purpose of AutoPPTX is to minimize the effort to utilize python-pptx, it reduces the flexibility to manipulate the entire presentation file. The API provides several ways to produce a presentation file:

  • PPTX_Construct: a module with more flexibility that is designed to produce a presentation file with standard structure and layout (typically a weekly or daily report with fixed layout but varied data source).
  • Data2Chart: a specific module to create slides with only charts
  • Data2Table: a specific module to create slides with only tables
  • Data2Text: a specific module to create slides with only text box

II. Example

1. Creating charts on pptx with Pandas

PPTX_Constructor

constructor = PptxConstructor({'prs_width': Inches(13), "prs_height": Inches(7)})
constructor.add_object(data=df1, object_type='chart', object_format={"chart_type": "line"})
constructor.add_object(data=df2, object_type='chart', slide_page=1)
constructor.add_object(data=df3, object_type='chart', position=('a', 0, 0, Cm(13), Cm(13)))
constructor.pptx_execute()
constructor.pptx_save()

Data2Chart

pptx = ChartCreator()
pptx.add_slide("main_page") 
pptx.add_slide("slide_2")  
pptx.add_slide("slide_3")  
# df is a pandas dataFrame
pptx.add_chart(data=df, slide_id="main_page", chart_type='line')  
pptx.add_chart(data=df, slide_id="slide_2", chart_type='bar')  
pptx.add_chart(data=df, slide_id="slide_3", chart_type='pie')
pptx.save("new.pptx")

Modified under The MIT License (MIT) Copyright (c) 2013 Steve Canny(https://github.com/scanny)

autopptx's People

Contributors

jumpingsquid avatar

Watchers

James Cloos avatar  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.