Haskell-like intervals for Python
Project description
autoreadme
Generate READMEs with collapsable* code and corresponding output from Python.
Installation
from package
# Set up a virtualenv.
python3 -m venv venv
source venv/bin/activate
# Install from PyPI
pip install autoreadme
from source
git clone https://github.com/davips/autoreadme
cd autoreadme
Example
A typical README-edit.md file would be:
# Uses
We can cook using the following Python code:
<<cook>>
However, we can also clean:
<<clean>>
The example file (given in this repo as examples/README-edit.md) depends on two scripts.
Each script should have a # ...
line where the output until that moment is expected to appear:
examples/cook.py:
# Cooking
x = 2 * 8
print("This script prints something:", x)
# ...
examples/clean.py:
# Cleaning
y = 34 % 5
print("this script prints another thing.", y)
# ...
Running...
autoreadme -i examples/README-edit.md -s examples/ -o examples/README.md examples/README-edit.md
...will result in the following markdown:
# UsesWe can cook using the following Python code:
Cooking
x = 2 * 8 print("This script prints something:", x)This script prints something: 16
However, we can also clean:
Cleaning
y = 34 % 5 print("this script prints another thing.", y)this script prints another thing. 4
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autoreadme-0.2101.12.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file autoreadme-0.2101.12.tar.gz
.
File metadata
- Download URL: autoreadme-0.2101.12.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd0b64332bc6df82363f45bff9ca7ccb8ee896d2b89453d1673577cf0c1d82e5 |
|
MD5 | e2b6e895ac2d1d92d0209568951d6485 |
|
BLAKE2b-256 | 11cdde96576d5236f79cdb579db2842894e43ae7dc92b282e1927c7c6678453f |
File details
Details for the file autoreadme-0.2101.12-py3-none-any.whl
.
File metadata
- Download URL: autoreadme-0.2101.12-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11480029c68d3af704fff6fe068a9470eb290eea936ba8081649f2cf699ba674 |
|
MD5 | f229467b0da59722d23ce3850416d7a4 |
|
BLAKE2b-256 | 8d61cda1b347dd0f46aa3e24836d153b99061732917b6dd289caa002c82530b6 |