asyncclick-repl
Command to make a REPL out of a group by passing -i or --interactive to the cli.
Inspired by click-repl but using native
click command and shell completion.
import asyncio
import asyncclick as click
from asyncclick_repl import AsyncREPL
@click.group(cls=AsyncREPL)
async def cli():
pass
@cli.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
async def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for _ in range(count):
await asyncio.sleep(0.1)
click.echo(f"Hello, {name}!")
cli(_anyio_backend="asyncio")
myclickapp -i
> hello --count 2 --name Foo
Hello, Foo!
Hello, Foo!
> :q
Features:
- Tab-completion. Using click's shell completion
- Execute system commands using
!prefix. Note:!should be followed by a space e.g! ls :hshow commands help.
Prompt configuration
Use prompt_kwargs to provide configuration to python-prompt-toolkit's Prompt class
import asyncclick as click
from prompt_toolkit.history import FileHistory
from asyncclick_repl import AsyncREPL
prompt_kwargs = {
"history": FileHistory("./history"),
}
@click.group(cls=AsyncREPL, prompt_kwargs=prompt_kwargs)
async def cli():
pass
cli()
Metadata
Release files for asyncclick-repl 0.1.2
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 |
|---|---|---|---|---|
| asyncclick_repl-0.1.2.tar.gz | 7.7 kB | Without provenance | Details for asyncclick_repl-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncclick_repl-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for asyncclick_repl-0.1.2-py3-none-any.whl |
Total release size: 14.0 kB
Release files / asyncclick_repl-0.1.2.tar.gz
| Download URL | asyncclick_repl-0.1.2.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8b724c01864b58c4415e78a83b162d253a335be9865ff1d8536ede8e3fd9d5a
|
|
BLAKE2b-256 checksum How to use checksums |
d9ca8897f9a25657e2491c59582e67956a650a0dc646f350431fc3e8617d835a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / asyncclick_repl-0.1.2-py3-none-any.whl
| Download URL | asyncclick_repl-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5aed90ca75b67eeee8933dbd2c095881ed7d0c5c2fdacbed23d8649d417153e9
|
|
BLAKE2b-256 checksum How to use checksums |
4d32ddb7ed3613b870ab48811271771458c616f6585cb3d1b54d1c2b0ac8ca54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for asyncclick-repl 0.1.2
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.