reportgen is a Python library for creating and updating analysis report.
Project description
Release v0.1.5
reportgen is a Python library for creating and updating analysis report.
Release History
0.1.5(2017-11-29)
Add function AnalysisReport, it can plot the general data to pptx files.
Fix some bugs.
0.1.1(2017-11-19)
fix some bugs.
0.1.0(2017-11-18)
Create.
Feature Support
reportgen has the following capabilities, with many more on the roadmap:
get all the texts in the pptx file
get all the images in the pptx file
add one slide simply about charts/tables/images with pandas in a pptx file
add slides simply about charts/tables/images with pandas in a pptx file
Quick Start
Get texts or images in a pptx file.
import reportgen as rpt
# Open a pptx file
p=rpt.Report('analysis.pptx')
# We can get the texts and images simply.
result=p.get_texts()
print('\n'.join(result))
# All the images will saved in folder '.\\images\\'.
p.get_images()
Created a analysis report.
import reportgen as rpt
import pandas as pd
# Open a pptx file
p=rpt.Report('template.pptx')# The parameters can be defaulted
# add a cover
p.add_cover(title='A analysis report powered by reportgen')
# add a chart slide
data=pd.DataFrame({'Jack':[90,80,100],'David':[100,70,85]},index=['Math','English','Physics'])
p.add_slide(data={'data':data,'slide_type':'chart','type':'COLUMN_CLUSTERED'},\
title='the scores report',summary='Our class got excellent results',footnote='This is a footnote.')
# add a table slide
data=pd.DataFrame({'Jack':[90,80,100],'David':[100,70,85]},index=['Math','English','Physics'])
p.add_slide(data={'data':data,'slide_type':'table'},title='the scores report',summary='Our class got excellent results',footnote='This is a footnote.')
# add a textbox slide
data='This a paragraph. \n'*4
p.add_slide(data={'data':data,'slide_type':'textbox'},title='This is a textbox slide',summary='',footnote='')
# add a picture slide
data='.\\images\\images.png'
p.add_slide(data={'data':data,'slide_type':'picture'},title='This is a picture slide')
p.save('analysis report.pptx')
In general, I divide a slide of analysis report into four parts: title銆乻ummary銆乫ootnote and the body data. And the body are one or more charts/textboxs/tables/pictures.
The add_slide which is the most commonly used function has the following parameters:
add_slide(data=[{'data':,'slide_type':,'type':},],title='',summary='',footnote='',layouts='auto')
For example, we can draw a chart on the left side, and insert a picture on the right.
import reportgen as rpt
import pandas as pd
p=rpt.Report()
scores=pd.DataFrame({'Jack':[90,80,100],'David':[100,70,85]},index=['Math','English','Physics'])
data=[{'data':scores,'slide_type':'chart','type':'COLUMN_CLUSTERED'},\
{'data':'.\\images2.jpg','slide_type':'picture'}]
p.add_slide(data=data)
p.save('add_slide.pptx')
As a lazy person, I also provide a solution with less scripts.
import reportgen as rpt
p=rpt.Report()
imgs=['.\\images\\'+img for img in os.listdir('.\\images\\')]
p.add_slides(data=imgs)
# more functions way
slides_data=[{'title':'ppt{}'.format(i),'data':data} for i in range(10)]
p.add.slides(slides_data)
p.save('add_slides.pptx')
Now you can get a glance at any data.
import pandas as pd
import reportgen as rpt
data=pd.read_excel('Scores.xlsx')
rpt.AnalysisReport(data,filename='Analysis Report of Scores.pptx');
The scripts will make a pptx file which analysis all the fields of the data in a visual way.
TO DO
support export analysis report to html
make the chart_type recommend more intelligence
Contact
If you have any question,you can email to gasongjian AT 126.com. And if you have a WeChat account,you can focus to my WeChat Official Account: JSong鑰佸笀.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reportgen-0.1.5.tar.gz.
File metadata
- Download URL: reportgen-0.1.5.tar.gz
- Upload date:
- Size: 52.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1b0fa54ba24af8b9a5bb2fc7005a58c4f353adcb9e43b729257a6a04e353ea1
|
|
| MD5 |
86823a9bc3a719b11752dcbceb3734bc
|
|
| BLAKE2b-256 |
6cac8eed3e2daed9998dc41d43a5aa7a444f2e0616ce6401d11106a8f862ee38
|
File details
Details for the file reportgen-0.1.5-py2.py3-none-any.whl.
File metadata
- Download URL: reportgen-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 55.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbb2bd85840e451b77d513d6c2ded9c2b76d42276cba14aa3f860a203d3b5fba
|
|
| MD5 |
931c8de5948ba24e1d6d279b66cc2a81
|
|
| BLAKE2b-256 |
b8da5d1ed652104c578092268a57a6964a8425fa929d443a698f755a321e16d9
|