Skip to main content

Turn Python scripts into handouts with Markdown and figures

Project description

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.

Code Handout
Code Handout

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 the example.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:

Feature Example
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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

handout-1.1.1.tar.gz (18.0 kB view details)

Uploaded Source

File details

Details for the file handout-1.1.1.tar.gz.

File metadata

  • Download URL: handout-1.1.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for handout-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dbe5da9b422fa937b94a1a5221ce99387ebd75fe97ab4255e49b26d846b8614b
MD5 cfdb0569b340ef1a978eb5c9cd008025
BLAKE2b-256 23939a77bbf965c854552a17286f11ad1e489028244baaf95575396e3763f344

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page