Render reproducible examples of Python code for sharing.
Reason this release was yanked:
Experimental early version
Project description
reprexlite: Python reproducible examples for sharing
reprexlite is tool for rendering reproducible examples of Python code for sharing. It will execute your code and embed the results as comments below their associated lines. It is a lightweight alternative to reprexpy and is similarly meant as a port of the R package reprex.
Installation
Development version
The development version of reprexlite is available on GitHub:
pip install https://github.com/jayqi/reprexlite.git#egg=reprexlite
Quick usage
Command-line interface
The reprexlite CLI allows you to create a reprex without entering Python. Simply invoke the command
reprex
This will take you into your system's default command-line text editor where you can type or paste your Python code. On macOS for example, this will be vi
. You can set your default editor using the $EDITOR
environment variable—I'm personally a fan of nano
.
Once you're done, reprexlite will print out your reprex to console.
Python library
from reprexlite import reprex
code = """
arr = [1, 2, 3, 4, 5]
[x + 1 for x in arr]
"""
print(reprex(code))
Comparison to reprexpy
Compared to reprexpy, reprexlite adds:
- A command-line interface so you can create reprexes without entering Python
- Lighter dependencies (e.g., no dependence on IPython)
However, reprexlite does not have:
- Direct ability to read from or write to your OS clipboard.
- Instead, the CLI opens your default text editor which you can paste into.
- Automatic upload of matplotlib plots to imgur.com.
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
Built Distribution
File details
Details for the file reprexlite-0.0.1.tar.gz
.
File metadata
- Download URL: reprexlite-0.0.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0fc57c34b91397fb8e366ea61d1c88cffdeb8aed3d56ef1deac2d5452a56c62 |
|
MD5 | 00d7116ea2d5cf16832b5a38b0ace171 |
|
BLAKE2b-256 | 05fad2ccd4a0cc6202278455abf2f4fa98135b3fe3027a6f46d9c6c62949ee3e |
File details
Details for the file reprexlite-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: reprexlite-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 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.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fedcd325a4db565068654651376461f8f03521d7adee41932b911054194b3703 |
|
MD5 | e2eb37f2d3784858253955080c3a8ee8 |
|
BLAKE2b-256 | d760ca30b24149aa6d649d90401d80bde58aa96065c604fd09dfdffa4368af1b |