Store the python return value of commands for the session.
If you like the idea click ⭐ on the repo and tweet.
Installation
To install use pip:
xpip install xontrib-pyrtn
# or: xpip install -U git+https://github.com/dyuri/xontrib-pyrtn
Usage
xontrib load xontrib_pyrtn
The xontrib adds two functions to the global namespace - In[] and Out[]. They are similar to ipython's In[] and Out[].
(In() and Out() is also available and does the same thing, except they can be called w/o argument and will show the list of input/output.)
A new PROMPT_FIELD pyhistnum is also added, to be able to include the number of the upcoming command (like in ipython).
Example
$ xontrib load pyrtn
$ $PROMPT = "[{pyhistnum}]$ "
[2]$ [12 * 3 + 6]
[42]
[3]$ In[2]
"[12 * 3 + 6]\n"
[4]$ Out[2] + [1]
[42, 1]
[5]$
Starship
For starship users, the xontrib also updates $PYRTN_HISTNUM after each command so it can be displayed with starship modules.
Example starship.toml snippet:
format = "...${env_var.PYRTN_HISTNUM}..."
[env_var.PYRTN_HISTNUM]
format = "[\\[]($style)[$env_value](bold)[\\] ]($style)"
style = "blue"
Credits
This package was created with xontrib cookiecutter template.
Metadata
Release files for xontrib-pyrtn 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xontrib_pyrtn-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for xontrib_pyrtn-0.3.0-py3-none-any.whl |
Release files / xontrib_pyrtn-0.3.0-py3-none-any.whl
| Download URL | xontrib_pyrtn-0.3.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9a42f786d5e4a1c170d1e0f0ddbcde70476429425d345b9b6446557c853174f
|
|
BLAKE2b-256 checksum How to use checksums |
747809e9756ea87d1e9f1e2c2ae5e3b0f00ad921066a60282262938aa57f2911
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for xontrib-pyrtn 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.