Skip to main content

Maintain tag sets easily and visually

Project description

textual_tagset

A utility to allow selection of choices, either singly or in groups.

To get a flavour of what the package can do, after installation run

python -m textual_tagset.demo

This lets you play with the four object types the tagset package offers choosing the number of items you want to work with. See the Demonstration section below.

The tagset demo utility

Dependency

Besides the usual Python ecosystem the sole requirement is the textual package itself.

For development you will need the poetry command. Installation is normally straightforward.

Installation

textual_tagset isn't currently available on PyPI, but will be. At present I'm interested in gathering comments. For the moment, please follow these instructions.

git clone git@github.com:holdenweb/textual_tagset.git

if you prefer to use HTTPS:

git clone https://github.com/holdenweb/textual_tagset.git

In either case, change into the directory you just created.

cd textual_tagset

We recommend you perform Python development work inside a virtual environment. To create a virtual environment with textual_tagset already installed, first select your Python version. Textual_tagset supports Python 3.8 onwards.

poetry env use 3.11

Then enter

poetry install

To build pip-installable artefacts, run

poetry build

This will create dist/textual_tagset-X.Y.Z.tar.gz and dist/textual_tagset-X.Y.Z-py3-none-any.whl, either of which can be installed with pip.

Demonstration

A simple demonstration of the modal version of each of the classes is available by using

make demo

NOTES:

To submit the result of the FilteredTagSet and the FilteredTagSetSelector you need to press Enter!

The make command requires poetry. If you haven't installed it, try

textual run textual_tagset.demo

Usage

A TagSet is a set of string tags. Clicking on a particular tag causes a TagSet.Selected Message to be raised. This has an```indexattribute that contains the numerical index of the selected element, and aselected` attribute containing the selected tag.

A FilteredTagset has the same interface as a TagSet but provides an Input to enter a filter string value to limit the choices visible in the TagSet for ease of selection. Pressing the Enter key the component raises a TagSetSelector.Selected signal whose values attribute holds the tags from the selected set.

The TagSetSelector lets you maintain two TagSets, one showing the the selected tags and the other showing other tags available for selection. Clicking on a tag moves it from it's present location to the other set.

As you might expect there's also a FilteredTagSetSelector, which uses FilteredTagSets for the values. The assumption here was that many more items would remain unselected than be selected,

Python API

TagSet and FilteredTagSet have the same API, as do TagSetSelector and FilteredTageSetSelector.

TagSet, FilteredTagSet

TagSetSelector, FilteredTagSetSelector

Documentation to be provided once API is stabilised.

Further development

Development work will aim to increase usability: User comments and issues are both warmly 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

textual_tagset-0.3.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

textual_tagset-0.3.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file textual_tagset-0.3.0.tar.gz.

File metadata

  • Download URL: textual_tagset-0.3.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for textual_tagset-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b0913f7b306e447fde845e13c8735635edd9357c62fa357ee20ac5eb555257b
MD5 363863cad71765e986db3969002b31ab
BLAKE2b-256 2e06cead9053a5db8c1f742ab4b85514131794fcf70d3221281f403a78449321

See more details on using hashes here.

File details

Details for the file textual_tagset-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: textual_tagset-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for textual_tagset-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6ada980e258652a65b169105bd29a9babcfe270050ed65af3650426deb078b5
MD5 f9eee08113c84f580a202bf75f4db1c5
BLAKE2b-256 4e2cbf085a4609aea3cf2e56733178e44f8e3708c634392e2d67494e431e457b

See more details on using hashes here.

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