SlideShare a Scribd company logo
1 of 54
Download to read offline
PYTHON TO REPORT IN
ONE COMMAND
Vicky Close, Second Measure
Talk overview
• Communicating insights
• Google Apps Script
• Coffee
About me
http://blog.secondmeasure.com/2016/04/26/chipotle-recovering-from-food-safety-scare/
http://www.forbes.com/sites/gilpress/2016/03/23/data-preparation-most-time-consuming-least-enjoyable-
data-science-task-survey-says/#581e921a7f75
My motivation
ipython
notebook
for analysis
Report in
Google Doc
Dashboards
(interactive?)
Excel
spreadsheets
Existing tools for creating reports
• There are lots of options!
Coffee prices data set
■ http://www.economicswebinstitute.org/ecdata.htm
■ Prices paid to growers in exporting ICO countries for
two coffee brands (Arabica and Robusta).
■ Retail price paid by consumer to commercial
distributer in importing ICO countries.
■ US cents per lb per month between 1982 and 2001.
nbconvert
ipython nbconvert --to html ipython nbconvert --to latex
Plotly
• Online data visualisation platform.
• Written using Python, Django, JavaScript,
D3.js.
• API library for Python.
Creating a map using Plotly
Prices paid to Arabica coffee growers
HTML reports using Plotly
http://moderndata.plot.ly/generate-html-reports-with-python-pandas-and-plotly/
Jinja2
• Template engine for Python.
http://jinja.pocoo.org/
http://pbpython.com/pdf-reports.html
ipython
notebook
Report
(html, pdf, …)
But…
• Not easy for other’s to add comments and
edits.
Google Drive API
• One of many Google APIs
• Has a python client library
• Upload and download files
• Convert files
https://developers.google.com/drive/v3/web/quickstart/python#prerequisites
Workflow
ipython
notebook
html
Google
Doc
ipython nbconvert
--to html
Google Drive API
Uploading files
http://wescpy.blogspot.co.uk/2015/12/google-drive-uploading-downloading.html
Google Apps Script
• Scripting language for application
development in the Google Apps platform.
• Create custom sidebars/menus in docs,
sheets and forms.
• Based on Javascript.
Workflow
ipython
notebook
json
Google
Doc
Google
Apps Script
Python
script
What is the underlying structure of an ipython notebook?
• Four different types of cells
• Heading
• Markdown
• Raw
• Code (output)
Markdown and heading cells
Code cells: Tables
‘#% table’ at beginning of cell
Use output field (html) + beautiful soup.
Code cells: Images
‘#% figure’ at beginning of cell
Extract name of figure
Json
Workflow
ipython
notebook
json
Google
Doc
Google
Apps Script
Python
script
Python to report in one command?
Step 1: Google Drive
API to upload images
to Google Drive
ipynb
Google
Drive
Step 3: Run Google
Apps Script using the
Python Execution API.
json
Google
Doc
Step 2: Python script
to convert ipynb to
json.
What I’ve learnt and what’s next?
• Automate report writing
• Harder project that I anticipated
• Google Apps Script is very versatile
• Comments, updates/edits
• Spreadsheets

More Related Content

Viewers also liked

Lightning large scale machine learning in python
Lightning  large scale machine learning in pythonLightning  large scale machine learning in python
Lightning large scale machine learning in pythonPyDataParis
 
Unit 15 - LO1 Poster
Unit 15 - LO1 PosterUnit 15 - LO1 Poster
Unit 15 - LO1 PosterTom Hibbert
 
Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPyDataParis
 
Collect pydata from your processes
Collect pydata from your processesCollect pydata from your processes
Collect pydata from your processesPyDataParis
 
Wendelin : From Stock Movements to Pivot Tables Inside Jupyter
Wendelin : From Stock Movements to Pivot Tables Inside JupyterWendelin : From Stock Movements to Pivot Tables Inside Jupyter
Wendelin : From Stock Movements to Pivot Tables Inside JupyterPyDataParis
 
Simple APIs and innovative documentation
Simple APIs and innovative documentationSimple APIs and innovative documentation
Simple APIs and innovative documentationPyDataParis
 
Witness Statement
Witness StatementWitness Statement
Witness StatementTom Hibbert
 

Viewers also liked (13)

Lightning large scale machine learning in python
Lightning  large scale machine learning in pythonLightning  large scale machine learning in python
Lightning large scale machine learning in python
 
Lo1
Lo1Lo1
Lo1
 
Unit 15 - LO1 Poster
Unit 15 - LO1 PosterUnit 15 - LO1 Poster
Unit 15 - LO1 Poster
 
Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandas
 
Collect pydata from your processes
Collect pydata from your processesCollect pydata from your processes
Collect pydata from your processes
 
Wendelin : From Stock Movements to Pivot Tables Inside Jupyter
Wendelin : From Stock Movements to Pivot Tables Inside JupyterWendelin : From Stock Movements to Pivot Tables Inside Jupyter
Wendelin : From Stock Movements to Pivot Tables Inside Jupyter
 
UNIT 35 - LO2
UNIT 35 - LO2UNIT 35 - LO2
UNIT 35 - LO2
 
Simple APIs and innovative documentation
Simple APIs and innovative documentationSimple APIs and innovative documentation
Simple APIs and innovative documentation
 
LO3
LO3LO3
LO3
 
Witness Statement
Witness StatementWitness Statement
Witness Statement
 
Lo3
Lo3Lo3
Lo3
 
Proposal
ProposalProposal
Proposal
 
Pitch LO4
Pitch LO4Pitch LO4
Pitch LO4
 

Similar to Python to report in one command

GRIN GLOBAL implementation - CIP 2017
GRIN GLOBAL implementation - CIP 2017GRIN GLOBAL implementation - CIP 2017
GRIN GLOBAL implementation - CIP 2017Edwin Rojas
 
The Internet of Things for Food - An integrated socio-economic and technologi...
The Internet of Things for Food - An integrated socio-economic and technologi...The Internet of Things for Food - An integrated socio-economic and technologi...
The Internet of Things for Food - An integrated socio-economic and technologi...Sjaak Wolfert
 
ODSC May 2019 - The DataOps Manifesto
ODSC May 2019 - The DataOps ManifestoODSC May 2019 - The DataOps Manifesto
ODSC May 2019 - The DataOps ManifestoDataKitchen
 
ICTs Along the Agriculture Value Chain
ICTs Along the Agriculture Value ChainICTs Along the Agriculture Value Chain
ICTs Along the Agriculture Value ChainIntegra LLC
 
Solair IoT for Smart Manufacturing
Solair IoT for Smart ManufacturingSolair IoT for Smart Manufacturing
Solair IoT for Smart ManufacturingSolair
 
2015 03-03 - global consumer electronics industry - imperatives in the digita...
2015 03-03 - global consumer electronics industry - imperatives in the digita...2015 03-03 - global consumer electronics industry - imperatives in the digita...
2015 03-03 - global consumer electronics industry - imperatives in the digita...Thorsten Schroeer
 
Real Time Analytics: Algorithms and Systems
Real Time Analytics: Algorithms and SystemsReal Time Analytics: Algorithms and Systems
Real Time Analytics: Algorithms and SystemsArun Kejariwal
 
Ajinomatrix v0.91 27-09-21
Ajinomatrix v0.91 27-09-21Ajinomatrix v0.91 27-09-21
Ajinomatrix v0.91 27-09-21lurching
 
Ajinomatrix v0.9 12-09-21
Ajinomatrix v0.9 12-09-21Ajinomatrix v0.9 12-09-21
Ajinomatrix v0.9 12-09-21lurching
 
Web carbon calculator
Web carbon calculatorWeb carbon calculator
Web carbon calculatorPetr Kirpeit
 
Connected Objects - Creating value through connectedness
Connected Objects - Creating value through connectednessConnected Objects - Creating value through connectedness
Connected Objects - Creating value through connectednessBagaar
 
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...Dataconomy Media
 
Big Data Berlin - Criteo
Big Data Berlin - CriteoBig Data Berlin - Criteo
Big Data Berlin - CriteoSofian Djamaa
 
Ict coca cola-case_study
Ict coca cola-case_studyIct coca cola-case_study
Ict coca cola-case_studyPiyush Virmani
 
Green Button in Ontario - A presentation to the Young Professionals in Energy
Green Button in Ontario - A presentation to the Young Professionals in EnergyGreen Button in Ontario - A presentation to the Young Professionals in Energy
Green Button in Ontario - A presentation to the Young Professionals in EnergyMaRS Discovery District
 
Scorecard and GDP| Canada| December 2020 and November 2020
Scorecard and GDP| Canada| December 2020 and November 2020Scorecard and GDP| Canada| December 2020 and November 2020
Scorecard and GDP| Canada| December 2020 and November 2020paul young cpa, cga
 

Similar to Python to report in one command (20)

Beverages
BeveragesBeverages
Beverages
 
GRIN GLOBAL implementation - CIP 2017
GRIN GLOBAL implementation - CIP 2017GRIN GLOBAL implementation - CIP 2017
GRIN GLOBAL implementation - CIP 2017
 
The Internet of Things for Food - An integrated socio-economic and technologi...
The Internet of Things for Food - An integrated socio-economic and technologi...The Internet of Things for Food - An integrated socio-economic and technologi...
The Internet of Things for Food - An integrated socio-economic and technologi...
 
ODSC May 2019 - The DataOps Manifesto
ODSC May 2019 - The DataOps ManifestoODSC May 2019 - The DataOps Manifesto
ODSC May 2019 - The DataOps Manifesto
 
ICTs Along the Agriculture Value Chain
ICTs Along the Agriculture Value ChainICTs Along the Agriculture Value Chain
ICTs Along the Agriculture Value Chain
 
Measuring GDP in a digitalised economy
 Measuring GDP in a digitalised economy Measuring GDP in a digitalised economy
Measuring GDP in a digitalised economy
 
Solair IoT for Smart Manufacturing
Solair IoT for Smart ManufacturingSolair IoT for Smart Manufacturing
Solair IoT for Smart Manufacturing
 
2015 03-03 - global consumer electronics industry - imperatives in the digita...
2015 03-03 - global consumer electronics industry - imperatives in the digita...2015 03-03 - global consumer electronics industry - imperatives in the digita...
2015 03-03 - global consumer electronics industry - imperatives in the digita...
 
Real Time Analytics: Algorithms and Systems
Real Time Analytics: Algorithms and SystemsReal Time Analytics: Algorithms and Systems
Real Time Analytics: Algorithms and Systems
 
Big data ppt
Big data pptBig data ppt
Big data ppt
 
Ajinomatrix v0.91 27-09-21
Ajinomatrix v0.91 27-09-21Ajinomatrix v0.91 27-09-21
Ajinomatrix v0.91 27-09-21
 
Ajinomatrix v0.9 12-09-21
Ajinomatrix v0.9 12-09-21Ajinomatrix v0.9 12-09-21
Ajinomatrix v0.9 12-09-21
 
Un:Think Introduction
Un:Think IntroductionUn:Think Introduction
Un:Think Introduction
 
Web carbon calculator
Web carbon calculatorWeb carbon calculator
Web carbon calculator
 
Connected Objects - Creating value through connectedness
Connected Objects - Creating value through connectednessConnected Objects - Creating value through connectedness
Connected Objects - Creating value through connectedness
 
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...
From 6 hours to 1 minute... in 2 days! How we managed to stream our (long) Ha...
 
Big Data Berlin - Criteo
Big Data Berlin - CriteoBig Data Berlin - Criteo
Big Data Berlin - Criteo
 
Ict coca cola-case_study
Ict coca cola-case_studyIct coca cola-case_study
Ict coca cola-case_study
 
Green Button in Ontario - A presentation to the Young Professionals in Energy
Green Button in Ontario - A presentation to the Young Professionals in EnergyGreen Button in Ontario - A presentation to the Young Professionals in Energy
Green Button in Ontario - A presentation to the Young Professionals in Energy
 
Scorecard and GDP| Canada| December 2020 and November 2020
Scorecard and GDP| Canada| December 2020 and November 2020Scorecard and GDP| Canada| December 2020 and November 2020
Scorecard and GDP| Canada| December 2020 and November 2020
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Python to report in one command