Skip to Content
Streamlining Your Research Laboratory with Python
book

Streamlining Your Research Laboratory with Python

by Mark F. Russo, William Neil
July 2025
Intermediate to advanced
384 pages
11h 53m
English
Wiley
Content preview from Streamlining Your Research Laboratory with Python

Chapter 10Report Generation

No investigation is complete without documenting and reporting results. The task of assembling experimental data and analysis results can be tedious, especially when a large amount of data is involved. Fortunately, many Python tools are available to make the job easier by automating the repetitive data assembly, visualization, and results dissemination.

Numerous Python modules provide simple programming interfaces that enable the programmatic generation of documents, presentations, and spreadsheets. In this chapter, we will introduce several modules for creating Microsoft Word, PowerPoint, and PDF documents. In Section 7.6, we introduced the openpyxl module, which can be used to create and programmatically populate Excel files.

Once generated, reports are often shared with colleagues. One convenient way to share reports is to deliver them through email. Another is to offer report downloads through a web browser. We’ll close this chapter with an introduction to the standards that form the basis for email and demonstrate how Python’s native modules are used to attach and email documents. We’ll also demonstrate how to start a built-in Python HTTP server, which can be used by others to access and download files from a remote computer.

10.1 BytesIO Object

The reports that we generate will include several images, especially those obtained from plotting data. We could save generated plots to temporary image files and then read the data back out of the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python Tools for Scientists

Python Tools for Scientists

Lee Vaughan
Algorithmic Management: The Role of AI in Managing Workforces

Algorithmic Management: The Role of AI in Managing Workforces

Mohammad Hossein Jarrahi, Mareike Möhlmann, Min Kyung Lee

Publisher Resources

ISBN: 9781394249886