danijar/handout

Turn Python scripts into handouts with Markdown and figures

Python

2,035

48 commits

updated Aug 28, 2021

See the code

README

Python Handout

PyPI

Turn Python scripts into handouts with Markdown comments and inline figures. An alternative to Jupyter notebooks without hidden state that supports any text editor.

CodeHandout
CodeHandout

Getting started

You use Python Handout as a library inside a normal Python program:

  1. Install via pip3 install -U handout.
  2. Run your script via python3 script.py. (You can start with examples/start.py from the repository.)
  3. Open output/index.html in your browser to view the result.
  4. Iterate and refresh your browser.

Features

Create the handout via doc = handout.Handout(outdir) to access these features:

FeatureExample
Add Markdown text as triple-quote comments."""Markdown text"""
Add text via print() syntax.doc.add_text('text:', variable)
Add image from array or url.doc.add_image(image, 'png', width=1)
Add video from array or url.doc.add_video(video, 'gif', fps=30, width=1)
Add matplotlib figure.doc.add_figure(fig, width=1)
Add custom HTML.doc.add_html(string)
Insert added items and save to <outdir>/index.html.doc.show()

Questions

Feel free to create an issue on Github.

data-science
notebook
productivity
prototyping
python
research

danijar/handout

Turn Python scripts into handouts with Markdown and figures

Python

2,035

48 commits

updated Aug 28, 2021

See the code

README

Python Handout

PyPI

Turn Python scripts into handouts with Markdown comments and inline figures. An alternative to Jupyter notebooks without hidden state that supports any text editor.

CodeHandout
CodeHandout

Getting started

You use Python Handout as a library inside a normal Python program:

  1. Install via pip3 install -U handout.
  2. Run your script via python3 script.py. (You can start with examples/start.py from the repository.)
  3. Open output/index.html in your browser to view the result.
  4. Iterate and refresh your browser.

Features

Create the handout via doc = handout.Handout(outdir) to access these features:

FeatureExample
Add Markdown text as triple-quote comments."""Markdown text"""
Add text via print() syntax.doc.add_text('text:', variable)
Add image from array or url.doc.add_image(image, 'png', width=1)
Add video from array or url.doc.add_video(video, 'gif', fps=30, width=1)
Add matplotlib figure.doc.add_figure(fig, width=1)
Add custom HTML.doc.add_html(string)
Insert added items and save to <outdir>/index.html.doc.show()

Questions

Feel free to create an issue on Github.

data-science
notebook
productivity
prototyping
python
research

Project health

Overall

2.0/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

1.1.2 · Nov 8, 2019

Releases this year

0

Significant stargazers

Arthur

18 followers · starred Aug 2019

Kevin Zakka

1,825 followers · starred Aug 2019

Dat Tran

1,372 followers · starred Aug 2019

Yen-Chen Lin

2,337 followers · starred Aug 2019