REPL on CLI
REPL extension to CLI apps
Example
import sys
from reploncli import reploncli
import my_cli_function, show_help
# turn on REPL mode if the first command line argument is 'repl'
lets_start_in_repl_mode = (sys.argv[1:] or [''])[0] == "repl"
reploncli(my_cli_function, lets_start_in_repl_mode, show_help, ">>> ")
reploncli()
Signature:
def reploncli(cli_function, repl_mode=None, help=None, prompt=""):
...
If repl_mode is True then REPL mode starts.
Wrap your CLI entry point
Create cli_function by wrapping your CLI entry point that accepts one optional argument with args to use as a replacement for sys.argv if given.
Otherwise process sys.argv as normal.
Shell commands
If an input in REPL mode starts with . then it's run by os.system() after removing that dot.
Metadata
Release files for reploncli 0.9.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reploncli-0.9.4.tar.gz | 3.1 kB | Without provenance | Details for reploncli-0.9.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reploncli-0.9.4-py3-none-any.whl | Python 3 | none | any | Details for reploncli-0.9.4-py3-none-any.whl |
Total release size: 6.4 kB
Release files / reploncli-0.9.4.tar.gz
| Download URL | reploncli-0.9.4.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
606643cfdb1f1a13ef0894d2ff5cb7a8cf6d7a1a1c1af7e6774736b7fec3881c
|
|
BLAKE2b-256 checksum How to use checksums |
0c626ecc981bc6230ec0e0a70183d6b715c145d461dbb91a227e56b8a04dcba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-52-generic
|
Release files / reploncli-0.9.4-py3-none-any.whl
| Download URL | reploncli-0.9.4-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca7bfe13257bdb01baa26c178cf7226a9768805f7e9ca44eaa3f7f2639ede972
|
|
BLAKE2b-256 checksum How to use checksums |
9473c54a6c6bea22711cf45dd520c48eefca56ac8013b62b3eb44eb583df8a40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-52-generic
|
Security for reploncli 0.9.4
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.