SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
Reporting
with Excel & Python
Felix Zumstein, 16 January 2020
xlwings Meetup London
Agenda
1. Excel for Reporting – but why?!
2. Alternatives to Excel
3. Excel Writer Libraries
4. Code vs. Template
5. Reporting with xlwings CE
6. Reporting with xlwings REPORTS
2
Introduction
Innovative Solutions
for Microsoft Excel
A small team with a big mission
4
xltrail
• Version control for
Excel
• Tracks formulas and
VBA code
5
xlwings
• xlwings CE
• xlwings PRO
• xlwings REPORTS
6
1. Excel for Reporting –
but why?!
What do you use xlwings for?
8
Source: xlwings Survey 2019 (Multiple answers were possible).
0% 10% 20% 30% 40% 50% 60% 70% 80%
Gradually migrate away from Excel
Write addins in Python
Machine Learning
Interactive session
As VBA replacement
Interfacing with external applications/databases/APIs
Use numpy/scipy etc.
Reports
One day on LinkedIn
9
“Hi, I just wanted to let you know that
xlwings has saved me hundreds of
hours in my current role. I replaced
the VBA reporting with it and
pyodbc and instead of taking 20-30
hours a month I can get the reports
run in 6-7. Thank you!”
Research Analyst, State Street
Over a cup of coffee
10
“We need a
better reporting
experience with
xlwings!”
Christian Fischer, Head of Investment
Analytics at Pension Fund of Credit Suisse
Group (Switzerland)
2. Alternatives to Excel
Alternative 1: HTML
12
There are some excellent web frameworks for
reporting available, like e.g. Dash
Source: https://dash-gallery.plotly.host/dash-financial-report/
Alternative 2: Direct PDF
13
ReportLab is a library to create high quality PDF
reports.
Source: https://www.reportlab.com/docs/reportlab-userguide.pdf
data = [['00', '01', '02', '03', '04’], ['10', '11', '12', '13', '14’],
['20', '21', '22', '23', '24’], ['30', '31', '32', '33', '34’]]
t = Table(data)
t.setStyle(TableStyle([('BACKGROUND', (1, 1), (-2, -2), colors.green),
('TEXTCOLOR', (0, 0), (1, -1), colors.red)]))
Alternative 3: BI Platforms
14
Crystal Reports
3. Excel Writer Libraries
Excel writer libraries
16
• OpenPyXL (xlsx/xlsm)
• XlsxWriter (xlsx/xlsm)
• xlwt (xls)
• Pandas (uses one of the above under the
hood)
Issues with writer libraries
17
• Formatting: If you use xlwt or XlsxWriter:
You have to do all the formatting in Python
• Editing: Only OpenPyXL can “edit” (i.e.
copy/write) xlsx files but has limitations: E.g.
Charts lose some formatting
• xlsb: None of the libraries can handle xlsb
files
Use writer libraries if you can
18
• Unlike xlwings, they run on your Linux server
and don’t require an installation of Excel. I.e.
they are scalable, and you won’t run into any
Excel automation issues.
• However, they’re having similar shortcomings
with regards to reporting like xlwings CE
4. Code vs. Template
Code (OpenPyXL Example)
20
cell.value = "My Report"
thin = Side(border_style="thin", color="000000")
cell.border = Border(top=thin, left=thin, right=thin, bottom=thin)
cell.font = Font(b=True, color="FF0000")
cell.alignment = Alignment(horizontal="center", vertical="center")
cell.fill = PatternFill(fgColor="FFFF00", fill_type="solid")
Template
21
• Designers are often no developers and
vice versa
• The next section shows the classic way of
using a template with xlwings CE
5. Reporting with xlwings CE
xlwings: The usual approach
23
wb = xw.Book('template.xlsx')
df = pd.DataFrame(index=['r0', 'r1’],
columns=['c0', 'c1’],
data=[[1, 2], [3, 4]])
wb.sheets["report"]["A1"].value = df
Issue 1: Template changes cause
code changes
24
wb.sheets["report"]["A1"].value = df
"A3"
Idea: Use named ranges
25
wb.sheets["report"]["mytable"].value = df
Pros:
• Moves around with cells
Cons:
• “invisible”
• You may need many for the same variable
Issue 2: Dynamic Tables
26
• Spacing issues
between tables
• Formatting
issues
6. Reporting with
xlwings REPORTS
How to get it
28
1) pip install xlwings-reports
2) Get a trial license key under:
www.xlwings.org/trial
Homepage & Docs: www.xlwings.org/reporting
xlwings REPORTS
29
• Complete separation of code and design
• Template variables (Jinja), e.g. {{ today }}
• Frames for dynamic tables
• Supports DataFrames, text, pictures etc.
• Customizable via xlwings CE
Basic syntax
30
from xlwings_reports import create_report
create_report('my_template.xlsx',
'my_report.xlsx',
title='Report',
df=pd.DataFrame(data=[[1, 2], [3, 4]]})
Demo
31
https://github.com/xlwings/xlwings-demo
Preview
Next Meetup: 24 March 2020
33
• Using in-memory objects to integrate Python in
Excel, Julij Jegorov
• Machine Learning and Excel, Colan Walsh (Founder
at Achilleon Consulting)
• Deployment of xlwings powered spreadsheets,
Felix Zumstein (Creator of xlwings)
Thank You
Let’s connect:
https://www.linkedin.com/in/felix-zumstein

Contenu connexe

Tendances

[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送Google Cloud Platform - Japan
 
20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMRAmazon Web Services Japan
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...Amazon Web Services Korea
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@EdgeAmazon Web Services Japan
 
KafkaとAWS Kinesisの比較
KafkaとAWS Kinesisの比較KafkaとAWS Kinesisの比較
KafkaとAWS Kinesisの比較Yoshiyasu SAEKI
 
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送Google Cloud Platform - Japan
 
AWS Black Belt Online Seminar 2017 Amazon VPC
AWS Black Belt Online Seminar 2017 Amazon VPCAWS Black Belt Online Seminar 2017 Amazon VPC
AWS Black Belt Online Seminar 2017 Amazon VPCAmazon Web Services Japan
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Ken SASAKI
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発Amazon Web Services Japan
 
シングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のりシングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のりShinichi Tomita
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAmazon Web Services Japan
 
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...Amazon Web Services Korea
 
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティスAmazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介Amazon Web Services Japan
 
AWS で Presto を徹底的に使いこなすワザ
AWS で Presto を徹底的に使いこなすワザAWS で Presto を徹底的に使いこなすワザ
AWS で Presto を徹底的に使いこなすワザNoritaka Sekiyama
 
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series Amazon Web Services Korea
 
SPARQLでオープンデータ活用!
SPARQLでオープンデータ活用!SPARQLでオープンデータ活用!
SPARQLでオープンデータ活用!uedayou
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...Amazon Web Services Japan
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPNAmazon Web Services Japan
 

Tendances (20)

[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
[Cloud OnAir] BigQuery へデータを読み込む 2019年3月14日 放送
 
20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
 
KafkaとAWS Kinesisの比較
KafkaとAWS Kinesisの比較KafkaとAWS Kinesisの比較
KafkaとAWS Kinesisの比較
 
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送
[Cloud OnAir] Google Cloud でセキュアにアプリケーションを開発しよう 2019年3月7日 放送
 
Black Belt Online Seminar AWS Amazon RDS
Black Belt Online Seminar AWS Amazon RDSBlack Belt Online Seminar AWS Amazon RDS
Black Belt Online Seminar AWS Amazon RDS
 
AWS Black Belt Online Seminar 2017 Amazon VPC
AWS Black Belt Online Seminar 2017 Amazon VPCAWS Black Belt Online Seminar 2017 Amazon VPC
AWS Black Belt Online Seminar 2017 Amazon VPC
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発
 
シングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のりシングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のり
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
 
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...
마이데이터 사업자 핀다에게 듣다! - 핀테크의 AWS 활용 전략 - 이지영 AWS 솔루션즈 아키텍트 / 박홍민 대표, 핀다 :: AWS S...
 
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
AWS で Presto を徹底的に使いこなすワザ
AWS で Presto を徹底的に使いこなすワザAWS で Presto を徹底的に使いこなすワザ
AWS で Presto を徹底的に使いこなすワザ
 
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS 서비스로 웹 애플리케이션 만들기 – 김주영, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
 
SPARQLでオープンデータ活用!
SPARQLでオープンデータ活用!SPARQLでオープンデータ活用!
SPARQLでオープンデータ活用!
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
 

Similaire à xlwings reports: Reporting with Excel & Python

RPA Summer School Session 3.1: Your first Excel and Word automations
RPA Summer School Session 3.1: Your first Excel and Word automationsRPA Summer School Session 3.1: Your first Excel and Word automations
RPA Summer School Session 3.1: Your first Excel and Word automationsCristina Vidu
 
Microsoft Excel 101: What you must know
Microsoft Excel 101: What you must knowMicrosoft Excel 101: What you must know
Microsoft Excel 101: What you must knowSwati Chhabra
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Pythonxlwings
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reportsxlwings
 
Automation Of Reporting And Alerting
Automation Of Reporting And AlertingAutomation Of Reporting And Alerting
Automation Of Reporting And AlertingSean Durocher
 
Master Microsoft Excel
Master Microsoft ExcelMaster Microsoft Excel
Master Microsoft ExcelEric Borda
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptRegroove
 
Lesson 1- Microsoft Excel 2010.pdf
Lesson 1- Microsoft Excel 2010.pdfLesson 1- Microsoft Excel 2010.pdf
Lesson 1- Microsoft Excel 2010.pdfNerissaVillarojas
 
New Features In Power Pivot 2010
New Features In Power Pivot 2010New Features In Power Pivot 2010
New Features In Power Pivot 2010Phuong Nguyen
 
50 Excel Shortcuts That You Should Know in 2022.docx
50 Excel Shortcuts That You Should Know in 2022.docx50 Excel Shortcuts That You Should Know in 2022.docx
50 Excel Shortcuts That You Should Know in 2022.docxKin Kan
 
Excel training
Excel trainingExcel training
Excel trainingseomonster
 
Elementary Data Analysis with MS Excel_Day-2
Elementary Data Analysis with MS Excel_Day-2Elementary Data Analysis with MS Excel_Day-2
Elementary Data Analysis with MS Excel_Day-2Redwan Ferdous
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in Indiaibinstitute0
 

Similaire à xlwings reports: Reporting with Excel & Python (20)

RPA Summer School Session 3.1: Your first Excel and Word automations
RPA Summer School Session 3.1: Your first Excel and Word automationsRPA Summer School Session 3.1: Your first Excel and Word automations
RPA Summer School Session 3.1: Your first Excel and Word automations
 
Microsoft Excel 101: What you must know
Microsoft Excel 101: What you must knowMicrosoft Excel 101: What you must know
Microsoft Excel 101: What you must know
 
Excel assignment help
Excel assignment helpExcel assignment help
Excel assignment help
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
 
Microsoft Excel
Microsoft ExcelMicrosoft Excel
Microsoft Excel
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reports
 
Automation Of Reporting And Alerting
Automation Of Reporting And AlertingAutomation Of Reporting And Alerting
Automation Of Reporting And Alerting
 
Master Microsoft Excel
Master Microsoft ExcelMaster Microsoft Excel
Master Microsoft Excel
 
EXCEL.pptx
EXCEL.pptxEXCEL.pptx
EXCEL.pptx
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScript
 
Lesson 1- Microsoft Excel 2010.pdf
Lesson 1- Microsoft Excel 2010.pdfLesson 1- Microsoft Excel 2010.pdf
Lesson 1- Microsoft Excel 2010.pdf
 
OpenRefine
OpenRefineOpenRefine
OpenRefine
 
New Features In Power Pivot 2010
New Features In Power Pivot 2010New Features In Power Pivot 2010
New Features In Power Pivot 2010
 
What is a spreadsheet
What is a spreadsheetWhat is a spreadsheet
What is a spreadsheet
 
50 Excel Shortcuts That You Should Know in 2022.docx
50 Excel Shortcuts That You Should Know in 2022.docx50 Excel Shortcuts That You Should Know in 2022.docx
50 Excel Shortcuts That You Should Know in 2022.docx
 
Excel training
Excel trainingExcel training
Excel training
 
Ms excel
Ms excelMs excel
Ms excel
 
Excel Basic Knowledge
Excel Basic KnowledgeExcel Basic Knowledge
Excel Basic Knowledge
 
Elementary Data Analysis with MS Excel_Day-2
Elementary Data Analysis with MS Excel_Day-2Elementary Data Analysis with MS Excel_Day-2
Elementary Data Analysis with MS Excel_Day-2
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
 

Plus de xlwings

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheetsxlwings
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excelxlwings
 
xlwings performance
xlwings performancexlwings performance
xlwings performancexlwings
 
Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)xlwings
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)xlwings
 
Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)xlwings
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooksxlwings
 
Git for Excel
Git for ExcelGit for Excel
Git for Excelxlwings
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooksxlwings
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinarxlwings
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesiansxlwings
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016xlwings
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsxlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentationxlwings
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings
 

Plus de xlwings (18)

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheets
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excel
 
xlwings performance
xlwings performancexlwings performance
xlwings performance
 
Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)
 
Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooks
 
Git for Excel
Git for ExcelGit for Excel
Git for Excel
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooks
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinar
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH event
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesians
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetup
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excel
 

Dernier

CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfsteffenkarlsson2
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesisparimabajra
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionMohammed Fazuluddin
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfSrushith Repakula
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesNeo4j
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMok TH
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 

Dernier (20)

CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesis
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptx
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 

xlwings reports: Reporting with Excel & Python

  • 1. Reporting with Excel & Python Felix Zumstein, 16 January 2020 xlwings Meetup London
  • 2. Agenda 1. Excel for Reporting – but why?! 2. Alternatives to Excel 3. Excel Writer Libraries 4. Code vs. Template 5. Reporting with xlwings CE 6. Reporting with xlwings REPORTS 2
  • 4. Innovative Solutions for Microsoft Excel A small team with a big mission 4
  • 5. xltrail • Version control for Excel • Tracks formulas and VBA code 5
  • 6. xlwings • xlwings CE • xlwings PRO • xlwings REPORTS 6
  • 7. 1. Excel for Reporting – but why?!
  • 8. What do you use xlwings for? 8 Source: xlwings Survey 2019 (Multiple answers were possible). 0% 10% 20% 30% 40% 50% 60% 70% 80% Gradually migrate away from Excel Write addins in Python Machine Learning Interactive session As VBA replacement Interfacing with external applications/databases/APIs Use numpy/scipy etc. Reports
  • 9. One day on LinkedIn 9 “Hi, I just wanted to let you know that xlwings has saved me hundreds of hours in my current role. I replaced the VBA reporting with it and pyodbc and instead of taking 20-30 hours a month I can get the reports run in 6-7. Thank you!” Research Analyst, State Street
  • 10. Over a cup of coffee 10 “We need a better reporting experience with xlwings!” Christian Fischer, Head of Investment Analytics at Pension Fund of Credit Suisse Group (Switzerland)
  • 12. Alternative 1: HTML 12 There are some excellent web frameworks for reporting available, like e.g. Dash Source: https://dash-gallery.plotly.host/dash-financial-report/
  • 13. Alternative 2: Direct PDF 13 ReportLab is a library to create high quality PDF reports. Source: https://www.reportlab.com/docs/reportlab-userguide.pdf data = [['00', '01', '02', '03', '04’], ['10', '11', '12', '13', '14’], ['20', '21', '22', '23', '24’], ['30', '31', '32', '33', '34’]] t = Table(data) t.setStyle(TableStyle([('BACKGROUND', (1, 1), (-2, -2), colors.green), ('TEXTCOLOR', (0, 0), (1, -1), colors.red)]))
  • 14. Alternative 3: BI Platforms 14 Crystal Reports
  • 15. 3. Excel Writer Libraries
  • 16. Excel writer libraries 16 • OpenPyXL (xlsx/xlsm) • XlsxWriter (xlsx/xlsm) • xlwt (xls) • Pandas (uses one of the above under the hood)
  • 17. Issues with writer libraries 17 • Formatting: If you use xlwt or XlsxWriter: You have to do all the formatting in Python • Editing: Only OpenPyXL can “edit” (i.e. copy/write) xlsx files but has limitations: E.g. Charts lose some formatting • xlsb: None of the libraries can handle xlsb files
  • 18. Use writer libraries if you can 18 • Unlike xlwings, they run on your Linux server and don’t require an installation of Excel. I.e. they are scalable, and you won’t run into any Excel automation issues. • However, they’re having similar shortcomings with regards to reporting like xlwings CE
  • 19. 4. Code vs. Template
  • 20. Code (OpenPyXL Example) 20 cell.value = "My Report" thin = Side(border_style="thin", color="000000") cell.border = Border(top=thin, left=thin, right=thin, bottom=thin) cell.font = Font(b=True, color="FF0000") cell.alignment = Alignment(horizontal="center", vertical="center") cell.fill = PatternFill(fgColor="FFFF00", fill_type="solid")
  • 21. Template 21 • Designers are often no developers and vice versa • The next section shows the classic way of using a template with xlwings CE
  • 22. 5. Reporting with xlwings CE
  • 23. xlwings: The usual approach 23 wb = xw.Book('template.xlsx') df = pd.DataFrame(index=['r0', 'r1’], columns=['c0', 'c1’], data=[[1, 2], [3, 4]]) wb.sheets["report"]["A1"].value = df
  • 24. Issue 1: Template changes cause code changes 24 wb.sheets["report"]["A1"].value = df "A3"
  • 25. Idea: Use named ranges 25 wb.sheets["report"]["mytable"].value = df Pros: • Moves around with cells Cons: • “invisible” • You may need many for the same variable
  • 26. Issue 2: Dynamic Tables 26 • Spacing issues between tables • Formatting issues
  • 28. How to get it 28 1) pip install xlwings-reports 2) Get a trial license key under: www.xlwings.org/trial Homepage & Docs: www.xlwings.org/reporting
  • 29. xlwings REPORTS 29 • Complete separation of code and design • Template variables (Jinja), e.g. {{ today }} • Frames for dynamic tables • Supports DataFrames, text, pictures etc. • Customizable via xlwings CE
  • 30. Basic syntax 30 from xlwings_reports import create_report create_report('my_template.xlsx', 'my_report.xlsx', title='Report', df=pd.DataFrame(data=[[1, 2], [3, 4]]})
  • 33. Next Meetup: 24 March 2020 33 • Using in-memory objects to integrate Python in Excel, Julij Jegorov • Machine Learning and Excel, Colan Walsh (Founder at Achilleon Consulting) • Deployment of xlwings powered spreadsheets, Felix Zumstein (Creator of xlwings)