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.2.tar.gz (18.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: handout-1.1.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for handout-1.1.2.tar.gz
Algorithm Hash digest
SHA256 52daaf1f9a4cb2ceb88c1dedf85d22ef449b9422b424a2534d21f941e57bc915
MD5 a08fc2d2afd1b26a053b9261233a1daf
BLAKE2b-256 a85e8e9a0e2eacdc10c1835056945be217889a3ebe2cc11e9e5dcce76105d81a

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