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
Features / TODO
- . . .
- Fix """ """ in excess after command without '# ...'
-
[ ] . . .
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.2102.20.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file autoreadme-0.2102.20.tar.gz
.
File metadata
- Download URL: autoreadme-0.2102.20.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 149dadc00dbc263179afb4433f3875709e9bb4079fa00543c2f313a2013b75ab |
|
MD5 | da5af59e281ee1bc971bb2b4b03cb1e8 |
|
BLAKE2b-256 | d32a32a33d7efd9cc62dddd1f4af1280770167f8eae5afa5ee9de2ed3161ca76 |
File details
Details for the file autoreadme-0.2102.20-py3-none-any.whl
.
File metadata
- Download URL: autoreadme-0.2102.20-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e43eb3ca24f1968cb4ee8e0c656ff5578ae34b4952ea45a1e7af099f8f936f0b |
|
MD5 | d4146c3232d46515c07ab8764d8175d1 |
|
BLAKE2b-256 | eb4d062c16da149ac5903a32bf7b25bb38c206b8ac3afda5dbbbde5a8a2fd9f9 |