prompt
Version: 17.0.0
Renders typed terminal output and captures interactive input through a nestable IoManager with indentation and verbosity
Table of Contents
Prompt IO Quickstart
WithIoManager: owning or sharing the IoManager
- Any class that needs prompt output should inherit
WithIoManager. - Call
self.ensure_io_manager()to lazily create or reuse anIoManager. - To inherit a parent’s indentation/verbosity, call
self.set_parent_io_handler(parent); every context you create is automatically nested +1. - If someone else instantiates the manager, call
self.use_io_manager(io)to reuse it instead of creating a new instance.
WithIoMethods: direct method proxies
- Mix in
WithIoMethodswhen you want to callself.log(...),self.separator(...), etc., without reaching intoself.io. - The mixin delegates missing attribute lookups to the underlying
IoManager, and it automatically injectscontext=self.create_io_context()so nested logging just works.
Typical pattern
from wexample_prompt.mixins.with_io_methods import WithIoMethods
class Worker(WithIoMethods):
def __attrs_post_init__(self):
self.ensure_io_manager() # Owns an IoManager
def run(self):
self.log("top level message") # via WithIoMethods
class Child(WithIoMethods):
def __attrs_post_init__(self, parent):
self.set_parent_io_handler(parent) # reuse & indent
def run(self):
self.log("nested message")
The executor or parent decides whether to create a fresh manager or cascade an existing one; children only call ensure_io_manager() and never worry about the init order.
Known Limitations & Roadmap
Current limitations and planned features are tracked in the GitHub issues.
See the project roadmap for upcoming features and improvements.
Status & Compatibility
Maturity: Production-ready
Python Support: >=3.10
OS Support: Linux, macOS, Windows
Status: Actively maintained
Tests
Run the test suite:
pytest tests/
With coverage:
pytest --cov=prompt tests/
Useful Links
- Homepage: https://github.com/wexample/python-prompt
- Issue Tracker: https://github.com/wexample/python-prompt/issues
- Discussions: https://github.com/wexample/python-prompt/discussions
- PyPI: pypi.org/project/wexample-prompt
Metadata
Release files for wexample-prompt 17.0.0
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 |
|---|---|---|---|---|
| wexample_prompt-17.0.0.tar.gz | 143.6 kB | Without provenance | Details for wexample_prompt-17.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wexample_prompt-17.0.0-py3-none-any.whl | Python 3 | none | any | Details for wexample_prompt-17.0.0-py3-none-any.whl |
Total release size: 356.1 kB
Release files / wexample_prompt-17.0.0.tar.gz
| Download URL | wexample_prompt-17.0.0.tar.gz |
|---|---|
| Size | 143.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8efb3e9f47ed8ccbb93f5ac4717aed0b4ae427cd8118d23cafb3b682dd6c921e
|
|
BLAKE2b-256 checksum How to use checksums |
12cc1c0f607d403ee9c7cb714c36758e9416149e1fccd9133e54ebdee0b1f974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.29.3 CPython/3.12.3 Linux/6.1.0-37-amd64
|
Release files / wexample_prompt-17.0.0-py3-none-any.whl
| Download URL | wexample_prompt-17.0.0-py3-none-any.whl |
|---|---|
| Size | 212.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99e26721e87f2b03b64a53216d8a1184a85b58505e80f25cf6f68635429c5f85
|
|
BLAKE2b-256 checksum How to use checksums |
a9ae32bbd53233c3c4762fa7ff9bede2367967d165d9cd3df755e120b21e895f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.29.3 CPython/3.12.3 Linux/6.1.0-37-amd64
|
Security for wexample-prompt 17.0.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.