Technology > Notebooker: From Jupyter Notebook to a reproducible report in a jiffy

TECH ARTICLE | 4 MIN

Notebooker: From Jupyter Notebook to a reproducible report in a jiffy

September 15, 2020

Man Group's newly open-sourced project, Notebooker, empowers users to publish their work with a few simple clicks.

Man Group's newly open-sourced project, Notebooker, empowers users to publish their work with a few simple clicks. Users can transform the code within their Jupyter Notebooks into scheduled, parametrised, production-quality reports which can be browsed in a convenient webapp. Jupyter Notebooks have become a ubiquitous tool for python analysis; the Notebooker project puts even more power and reliability in the hands of our users.

The Notebooker logo

From research to reproducibility

Jupyter Notebooks are a fantastic tool for researchers, data scientists, and developers alike. Supporting a vast array of popular programming languages including Python, Ruby, and R, they allow for the super-fast iteration of ideas with code separated into “cells” and results presented inline, whether they be in a tabular format or in charts.

An example of a Jupyter Notebook

Despite their usefulness as a research tool, often the hard work put into the code within a Jupyter Notebook is lost. Either the notebook is converted into a scheduled report by a developer, or the notebook is never executed again: the results will be saved and become stale on the user’s hard drive. Additionally, if we wish to productionise the notebooks themselves, there are several properties which are traditionally difficult with Jupyter Notebooks, namely: code review, testability, re-usability, execution, and browsing of results. Here’s how Notebooker aims to resolve each:

The above report, but presented within Notebooker

Reviewability

When a change is made, one of the most critical steps before a report lands in production is peer review. In order to facilitate this in Notebooker, Notebooks are converted from .ipynb to .py using Jupytext. This turns the raw, difficult-to-review .ipynb into a much more user-friendly python file so that changes can be properly scrutinised. See this article for an example of how Jupytext works.

Testability

It’s important to ensure that once you’ve written a report that it will continue working in the future, preventing breakages either through external changes or future enhancements. Notebooker reports can be regression tested via a command-line tool which uses pytest, so that we can catch any errors before they happen in production.

Re-usability

By adding a parameters cell which can be consumed by papermill, Jupyter Notebooks can be used as a template for 10s or 100s of reports with the same or similar output when parametrised. For example, if you want to run a report per country, you only have to write one Jupyter Notebook and add a parameter for the country in question. You can then schedule a task to run the same report with different inputs, meaning you only had to write the code once. Within the webapp it’s also possible simply to type the parameters as if you are writing Python in a Jupyter cell. This allows for live experimentation with different parameters running in parallel on the webapp.

Executablility

Notebooker reports can either be executed by users on a webapp front-end, or via command-line. For example, a researcher may want to play around with values on the webapp and then schedule a cron job to run the report with those parameters every day. There’s also an option to email results and produce PDF output. Regardless of execution method, results are saved into the MongoDB database for later retrieval.

Browsability

Once we’ve run the report, we want to view it! To allow for this, the Notebooker homepage allows for searching and browsing of all results, with convenient ways to download rendered PDFs and view the reports online. When a notebook has been executed and the results are presented to the user, they may want to also share the results with colleagues. Notebooker URLs for results are unique and will reliably link the recipient to the intended report. The MongoDB database allows us to search for results in a variety of ways: for example, if a report has been run with the parameter ticker="$AAPL", we can find the most recent report with this parameter and present it to the user.

The Notebooker homepage

Deploying to Notebooker

Finally, when you’re happy with your Jupyter Notebook, deployment to Notebooker consists of the following steps:

  1. Convert your .ipynb to .py using Jupytext
  2. Commit the .py file into git
  3. Merge the .py file into the production branch

… and that’s it! The Notebook will appear on the deployed Notebooker instance as a template which can be executed on-demand and scheduled using an external job scheduler such as cron, Airflow, or Jenkins. A feature which we hope to add soon is the ability to schedule reports directly from the Notebooker webapp.

Final Thoughts

Since its inception in late 2018, Notebooker has been a successful addition to the internal toolkit within Man Group, with usages as varied as support dashboards, JIRA reporting, and portfolio drilldowns. We’re delighted to announce that we have open-sourced Notebooker and it is readily available at https://github.com/man-group/notebooker. We hope that you can make use of it too, so check it out on GitHub today!

This information is communicated and/or distributed by the relevant Man entity identified below (collectively the "Company") subject to the following conditions and restriction in their respective jurisdictions.

Opinions expressed are those of the author and may not be shared by all personnel of Man Group plc (‘Man’). These opinions are subject to change without notice, are for information purposes only and do not constitute an offer or invitation to make an investment in any financial instrument or in any product to which the Company and/or its affiliates provides investment advisory or any other financial services. Any organisations, financial instrument or products described in this material are mentioned for reference purposes only which should not be considered a recommendation for their purchase or sale. Neither the Company nor the authors shall be liable to any person for any action taken on the basis of the information provided. Some statements contained in this material concerning goals, strategies, outlook or other non-historical matters may be forward-looking statements and are based on current indicators and expectations. These forward-looking statements speak only as of the date on which they are made, and the Company undertakes no obligation to update or revise any forward-looking statements. These forward-looking statements are subject to risks and uncertainties that may cause actual results to differ materially from those contained in the statements. The Company and/or its affiliates may or may not have a position in any financial instrument mentioned and may or may not be actively trading in any such securities. Unless stated otherwise all information is provided by the Company. Past performance is not indicative of future results.

Unless stated otherwise this information is communicated by the relevant entity listed below.

Australia: To the extent this material is distributed in Australia it is communicated by Man Investments Australia Limited ABN 47 002 747 480 AFSL 240581, which is regulated by the Australian Securities & Investments Commission ('ASIC'). This information has been prepared without taking into account anyone’s objectives, financial situation or needs.

Austria/Germany/Liechtenstein: To the extent this material is distributed in Austria, Germany and/or Liechtenstein it is communicated by Man (Europe) AG, which is authorised and regulated by the Liechtenstein Financial Market Authority (FMA). Man (Europe) AG is registered in the Principality of Liechtenstein no. FL-0002.420.371-2. Man (Europe) AG is an associated participant in the investor compensation scheme, which is operated by the Deposit Guarantee and Investor Compensation Foundation PCC (FL-0002.039.614-1) and corresponds with EU law. Further information is available on the Foundation's website under www.eas-liechtenstein.li.

European Economic Area: Unless indicated otherwise this material is communicated in the European Economic Area by Man Asset Management (Ireland) Limited (‘MAMIL’) which is registered in Ireland under company number 250493 and has its registered office at 70 Sir John Rogerson's Quay, Grand Canal Dock, Dublin 2, Ireland. MAMIL is authorised and regulated by the Central Bank of Ireland under number C22513.

Hong Kong SAR: To the extent this material is distributed in Hong Kong SAR, this material is communicated by Man Investments (Hong Kong) Limited and has not been reviewed by the Securities and Futures Commission in Hong Kong.

Japan: To the extent this material is distributed in Japan it is communicated by Man Group Japan Limited, Financial Instruments Business Operator, Director of Kanto Local Finance Bureau (Financial instruments firms) No. 624 for the purpose of providing information on investment strategies, investment services, etc. provided by Man Group, and is not a disclosure document based on laws and regulations. This material can only be communicated only to professional investors (i.e. specific investors or institutional investors as defined under Financial Instruments Exchange Law) who may have sufficient knowledge and experience of related risks.

Switzerland: To the extent this material is made available in Switzerland the communicating entity is:

  • For Clients (as such term is defined in the Swiss Financial Services Act): Man Investments (CH) AG, Huobstrasse 3, 8808 Pfäffikon SZ, Switzerland. Man Investment (CH) AG is regulated by the Swiss Financial Market Supervisory Authority (‘FINMA’); and
  • For Financial Service Providers (as defined in Art. 3 d. of FINSA, which are not Clients): Man Investments AG, Huobstrasse 3, 8808 Pfäffikon SZ, Switzerland, which is regulated by FINMA.

United Kingdom: Unless indicated otherwise this material is communicated in the United Kingdom by Man Solutions Limited ('MSL') which is a private limited company registered in England and Wales under number 3385362. MSL is authorised and regulated by the UK Financial Conduct Authority (the 'FCA') under number 185637 and has its registered office at Riverbank House, 2 Swan Lane, London, EC4R 3AD, United Kingdom.

United States: To the extent this material is distributed in the United States, it is communicated and distributed by Man Investments, Inc. (‘Man Investments’). Man Investments is registered as a broker-dealer with the SEC and is a member of the Financial Industry Regulatory Authority (‘FINRA’). Man Investments is also a member of the Securities Investor Protection Corporation (‘SIPC’). Man Investments is a wholly owned subsidiary of Man Group plc. The registration and memberships described above in no way imply a certain level of skill or expertise or that the SEC, FINRA or the SIPC have endorsed Man Investments. Man Investments Inc, 1345 Avenue of the Americas, 21st Floor, New York, NY 10105.

This material is proprietary information and may not be reproduced or otherwise disseminated in whole or in part without prior written consent. Any data services and information available from public sources used in the creation of this material are believed to be reliable. However accuracy is not warranted or guaranteed. © Man 2025