At Man Group we use Python, a high-level programming language which combines ease-of-use with extremely powerful projects such as pandas, SciPy, and JupyterLab. To facilitate writing Python, the JupyterLab framework allows users to write code in a "notebook" and immediately interact with the results. This is especially useful when performing exploratory analysis, as it allows for easy modification and sharing of results. However, once a JupyterLab user is satisfied with the output of the notebook, it is quite difficult to convert this notebook into a flexible and high-quality report. This is where Notebooker comes in! With the introduction of the Notebooker project, in a few clicks a Jupyter Notebook can become an on-demand report. With the latest update to Notebooker, it is possible to take this a step further and schedule reports to be run on an ongoing basis.

Notebooker allows users to deploy their own work using simple git pushes, immediately relaying the changes to Notebooker's web front end, and allowing for on-demand running of the notebook. This allows us to transform a static, one-off Jupyter Notebook into a "Notebook Template" upon which future reports can be executed and parametrised. For example, a report which produces a chart for AAPL US could be parametrised to take any given ticker and produce the corresponding chart. In a very short amount of time, a set of reports for an entire portfolio of tickers can be produced from one Jupyter Notebook within a few clicks. The rendered PDF or HTML results can also be sent via email upon completion. As an added benefit, you can toggle whether to see the underlying code in the final output, which means that the final output is free of code but experts can dip in and investigate the methodology if they so choose.

This has proven to be a very useful tool within Man Group and has been used in several different situations, ranging from simple support dashboards to fully-fledged portfolio management solutions. However, in order to further enhance these reports and to use them on an ongoing basis, it was necessary to schedule reports using external solutions such as Apache Airflow and Jenkins. With the introduction of Notebooker version 0.4.0, it is now possible to schedule reports to be run from within the webapp on a regular basis.

Scheduling your Notebooks

To schedule a Jupyter Notebook as a report, we need a Jupyter Notebook and a Notebooker webapp. To set up an instance of the Notebooker webapp with your first Notebook, follow the setup, steps add your Notebook, and optionally add a "parameters" cell.

From your Notebooker instance, click "Execute a Notebook", select your Notebook name, and run the report. You should soon be presented with the results (or errors which need to be fixed!).

Once you are happy with the output, it's time to add a schedule using the new Notebooker Scheduler, accessible from the "Scheduler" button in the top toolbar.

You will now be presented with the Scheduling screen, which provides a handy overview of all schedules on the current Notebooker webapp. To create a new schedule, click "Add a Schedule" on the left of the screen. The first thing to do is to select a title for the recurring report: this will be important when referring later on to different schedules, but also it will be the title of the exported PDF version of the report - so choose wisely!

Once this is done, you need to select a Notebook Template to execute. This will be the relative path of the notebook template within the notebook template’s git repo. In the images of this article, we are executing templates from the `examples` directory. Having selected a Notebook Template, the default parameters of the report will be populated below. These can be overridden by writing simple python that assigns values to variables. Following this, you can choose how the report is distributed beyond the webapp itself; whether you want the report to be emailed, generated as a PDF, or even to hide the code output within the generated PDF.

Finally, and most importantly, you choose the schedule using cron syntax. A little popup will inform you of how Notebooker will interpret these instructions by illustrating the next time the report will be executed by the scheduler. Once you're happy, hit ‘Submit’ and you will be returned to the scheduler screen.

When the scheduled report has finished running, you will be able to access it via the main screen - something which has also been significantly reworked with the latest Notebooker update. Now, you are presented with a choice of report templates for displaying results. It's also possible to see how long ago the last report was executed, and how many of those reports were manually run as opposed to being run by the scheduler. When the card is clicked, you are now shown a more detailed screen with job runs, information on the parameters which were used to execute the report alongside helpful links to the scheduler and a PDF render of results. As an additional feature, it is possible to get a permalink which will guide users to the latest run of the report and parameters as specified within the URL.

How you can get started

If you already have a Notebooker instance, upgrade to version 0.4.0 or later to get all these benefits. A complete list of enhancements and bugfixes is available here: https://github.com/man-group/notebooker/releases.

If you don't have Notebooker yet, check out the docs at https://notebooker.readthedocs.io/en/latest/ for an in-depth guide.

Check out Notebooker at https://github.com/man-group/notebooker and don't forget to leave a star if you liked the project!

 

I am interested in other Tech Articles.

To receive e-mail alerts whenever new Tech Articles or Events are posted on this site, please subscribe below.

Subscribe

 

Find out more about Technology at Man Group

Important information

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. This material is of a promotional nature.

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. This material can only be communicated to intermediaries, and professional clients who are within one of the professional investors exemptions contained in the Securities and Futures Ordinance and must not be relied upon by any other person(s).

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 the material is distributed in Switzerland the communicating entity is Man Investments AG, Huobstrasse 3, 8808 Pfäffikon SZ, Switzerland. Man Investment AG is regulated by the Swiss Financial Market Supervisory Authority ('FINMA').

United Kingdom: Unless indicated otherwise this material is communicated in the United Kingdom by Man Solutions Limited (‘MSL’) which is an investment company as defined in section 833 of the Companies Act 2006. MSL is registered in England and Wales under number 3385362 and has its registered office at Riverbank House, 2 Swan Lane, London, EC4R 3AD, United Kingdom. MSL is authorised and regulated by the UK Financial Conduct Authority (the ‘FCA’) under number 185637.

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, 452 Fifth Avenue, 27th fl., New York, NY 10018.

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 2022

MKT004196/ST/GL/W

Please update your browser

Unfortunately we no longer support Internet Explorer 8, 7 and older for security reasons.

Please update your browser to a later version and try to access our site again.

Many thanks.