Skip to main content

A lightweight widget framework for Python terminal apps

Project description

pywidgy

A lightweight, composable widget framework for Python terminal apps.

Example image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywidgy-0.1.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywidgy-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for pywidgy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cc87135b270cc823e8d2fd55e1f4fc728d67f7327cf65f615faf6b7a64fc71b9
MD5 bedf19079536f81dfbc3cc76f6fc6c7f
BLAKE2b-256 f6352af3c227caa31c3ca1c3d5ac9da1561b667bac2d7a5c9130610e6bcf92f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywidgy-0.1.2.tar.gz:

Publisher: release.yml on epersni/pywidgy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pywidgy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41eeaf11adbb514d2215bea36d6419702c171dac8aac158cf54d0275220a9d80
MD5 e26598a6806c27dd44e4aee99f58cb09
BLAKE2b-256 bd016c997bcfb8afc5b36644455c9dc8cdfc237fea61f3108c2a94f146b4416a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywidgy-0.1.2-py3-none-any.whl:

Publisher: release.yml on epersni/pywidgy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page