Skip to main content

Haskell-like intervals for Python

Project description

test codecov

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:

# Uses

We 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


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

Uploaded Source

Built Distribution

autoreadme-0.2102.16-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file autoreadme-0.2102.16.tar.gz.

File metadata

  • Download URL: autoreadme-0.2102.16.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

Hashes for autoreadme-0.2102.16.tar.gz
Algorithm Hash digest
SHA256 9e5acf943401f7d416673f15807fa4ecef63d0a87cd168c97976d416e45f54b0
MD5 260aeb92d3401130cff7ec2981871b9a
BLAKE2b-256 6a2b343ef192c4c79897ce93de8bedcb8c5256c7120b74f324ac730f0bbfeae1

See more details on using hashes here.

File details

Details for the file autoreadme-0.2102.16-py3-none-any.whl.

File metadata

  • Download URL: autoreadme-0.2102.16-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

Hashes for autoreadme-0.2102.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2fc6cbc5152e9cc46fd0579af2250a4af20b3eb2ec2c84617e0684ef74a5c1a2
MD5 adf82658c04f0c8562496856c534daaa
BLAKE2b-256 d6fcacf9b82e8c86274d4a02fd99eb77641d69581ec9eaad5adbc68d80402805

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