Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danijar/handout
Turn Python scripts into handouts with Markdown and figures
https://github.com/danijar/handout
data-science notebook productivity prototyping python research
Last synced: 7 days ago
JSON representation
Turn Python scripts into handouts with Markdown and figures
- Host: GitHub
- URL: https://github.com/danijar/handout
- Owner: danijar
- License: apache-2.0
- Created: 2018-08-28T15:30:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-28T07:48:24.000Z (over 3 years ago)
- Last Synced: 2024-11-29T08:03:52.515Z (14 days ago)
- Topics: data-science, notebook, productivity, prototyping, python, research
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 2,015
- Watchers: 47
- Forks: 105
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starts - danijar/handout - Turn Python scripts into handouts with Markdown and figures (Python)
README
# Python Handout
[![PyPI](https://img.shields.io/pypi/v/handout.svg)](https://pypi.python.org/pypi/handout/#history)
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](https://i.imgur.com/YEvUB9U.png) | ![Handout](https://i.imgur.com/dEGxaAz.png) |## 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:
| Feature | Example |
| ------- | ------- |
| Add [Markdown text][markdown] 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 `/index.html`. | `doc.show()` |[markdown]: https://commonmark.org/help/
## Questions
Feel free to create an issue on Github.