A lightweight widget framework for Python terminal apps
Project description
pywidgy
A lightweight, composable widget framework for Python terminal apps.
Install
pip install pywidgy
Quickstart
Here is a simple example to create a dialog for with checkboxes. For more examples see examples/ directory.
#!/usr/bin/env python3
import sys
import pywidgy
from pywidgy import Checkboxes
def main() -> int:
pywidgy.init()
widget=Checkboxes(
title="Select your xepa:",
options=["apa", "bepa", "cepa", "depa", "eepa", "fepa"],
size=(80, 100),
exit_cb=pywidgy.close,
)
pywidgy.spawn(widget)
pywidgy.run()
selected=widget.selected
print(f"You selected {selected}")
return 0
if __name__ == "__main__":
sys.exit(main())
Development
Using nix it is very easy to start developing. Just do
nix develop
to get the development environment up and running. From within the development environment you can run use tox build targets to run linter, formatter, mypy, etc.
To run all statical code analysis, run
tox -e lint
and to format the code, run
tox -e format
Contributing
Contributions, reporting issues and feature requests are welcome!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywidgy-0.1.2.tar.gz.
File metadata
- Download URL: pywidgy-0.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc87135b270cc823e8d2fd55e1f4fc728d67f7327cf65f615faf6b7a64fc71b9
|
|
| MD5 |
bedf19079536f81dfbc3cc76f6fc6c7f
|
|
| BLAKE2b-256 |
f6352af3c227caa31c3ca1c3d5ac9da1561b667bac2d7a5c9130610e6bcf92f4
|
Provenance
The following attestation bundles were made for pywidgy-0.1.2.tar.gz:
Publisher:
release.yml on epersni/pywidgy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pywidgy-0.1.2.tar.gz -
Subject digest:
cc87135b270cc823e8d2fd55e1f4fc728d67f7327cf65f615faf6b7a64fc71b9 - Sigstore transparency entry: 601031847
- Sigstore integration time:
-
Permalink:
epersni/pywidgy@1c792918582b88c749f1747a9de332d44228c6da -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/epersni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c792918582b88c749f1747a9de332d44228c6da -
Trigger Event:
release
-
Statement type:
File details
Details for the file pywidgy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pywidgy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41eeaf11adbb514d2215bea36d6419702c171dac8aac158cf54d0275220a9d80
|
|
| MD5 |
e26598a6806c27dd44e4aee99f58cb09
|
|
| BLAKE2b-256 |
bd016c997bcfb8afc5b36644455c9dc8cdfc237fea61f3108c2a94f146b4416a
|
Provenance
The following attestation bundles were made for pywidgy-0.1.2-py3-none-any.whl:
Publisher:
release.yml on epersni/pywidgy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pywidgy-0.1.2-py3-none-any.whl -
Subject digest:
41eeaf11adbb514d2215bea36d6419702c171dac8aac158cf54d0275220a9d80 - Sigstore transparency entry: 601031849
- Sigstore integration time:
-
Permalink:
epersni/pywidgy@1c792918582b88c749f1747a9de332d44228c6da -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/epersni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c792918582b88c749f1747a9de332d44228c6da -
Trigger Event:
release
-
Statement type: