Skip to main content

Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.

Project description

listpick

listpick is a powerful TUI data tool for viewing, editing and operating upon tabulated data; can be used to build TUI applications, generate data columns, or function as a command-line utility.

NOTE: listpick is still in development.

Quickstart

Install listpick:

python -m pip installl "listpick[full]"

Create a Picker:

from listpick.listpick_app import Picker, start_curses, close_curses

if __name__ == "__main__":
    stdscr = start_curses()

    x = Picker(
        stdscr,
        items=[
            ["row zero column zero", "row zero column one"],
            ["row one column zero", "row one column one"]
        ],
        header=["H0", "H1"],
        cell_cursor=True,
    )
    x.run()

    close_curses(stdscr)

Overview

The application allows you to:

  • Select multiple items from different file types and input streams
  • Delete individual items
  • Highlight specific items for quick selection
  • Filtering: supports regular expressions for row- and column-based filtering.
  • Searching: supports regular expressions for row- and column-based searching.
  • Sort data based on specified columns and sort-type
  • Save and load data.
  • Copy/paste selections to clipboard
  • Generate rows from a list of commands in an input.toml file.

Examples

listpick as a command-line tool

listpick can be used as a command-line tool for tabulating command outputs:

df -h | listpick --stdin
lpfman

Applications

Aria2TUI

Aria2TUI: TUI client for the aria2c download utility.

Aria2TUI

lpfman

lpfman: Terminal file manager with extensive column support.

lpfman

Data generation from toml file

listpick -g ./listpick/examples/data_generation/video_duplicates.toml
  • From the list of commands in the toml file we generate the properties we will use to identify the duplicates.

  • In the example file we set the directory and get the files with a simle eza (ls) command. We could also use find or cat from a list of files.

  • We get the SHA1 hash to identify identical files; we also get the size, duration, resolution, and bitrate so that we can identify a video duplicate that may have the same duration but a lower resolution.

Video Compare

Description

Key Features:

  1. File Input Support:
listpick -i ~/items.csv
  • Text files (TSV, CSV)
  • JSON
  • XLSX
  • ODS
  • Pickle
  1. Pipe data to listpick:
df -h | listpick --stdin
  1. Generate data based on an toml file with relevant commands to generate the rows.
listpick -g ./examples/data_generation/video_duplicates.toml
  • See ./examples/data_generation/
  1. Highlighting:
  • Highlight specific strings for display purposes.
  • E.g., when we search for a string we will highlight strings in the rows that match the search.
  1. Filtering and Sorting:
  • Apply custom filters and sort criteria on the fly
  1. Modes:
  • Default modes are supported so that a certain filter/search/sort can structure the data in a way that is easy to move between.
  1. Options:
  • Along with returning the selected rows, the user can also return options.
  • Input field with readline support
  • Options select box
  1. Colour themes:
  • Several colour themes are available
  1. Copy rows:
  • 'y' to copy rows in various formats: CSV, TSV, python list
  1. Save data:
  • Data can be saved so that it can be loaded with the -i flag.
  • This is very helpful if your data generation takes a long time.
  1. Customisable keybinds:
  • The Picker object takes a keys_dict variable which allows all keys to be customised. Default keys can be seen in src/listpick/ui/keys.py.
  • Also allows the restriction of certain functions by not assigning a key.
  1. Dynamic or manual refresh of data:
  • If a refresh_function is passed with auto_refresh=True then listpick will automatically refresh the data. - If a refresh_function is passed then one can also manually refresh by pressing f5.
  1. Notifications.
  • Supports notifications upon certain events
  1. Visual options
  • Display/hide title.
  • Display/hide footer with selection information
  • Display/hide columns
  • Display/hide highlights
  • Option to centre in cells, centre in terminal and centre rows vertically.
  1. Change settings on the fly.
  • Press '~' to see list of display settings or press '`' to enter a command to change display settings.
  • Change visual options
    • Cycle through themes
    • Centre data in cells or centre rows vertically
    • Show/hide the footer
    • Show/hide a specific column.
    • Select a column
  • Toggle auto-refresh
  • Toggle highlights
  1. Pipe the data from the selected rows in the focussed column to a bash command ('|')
  • By default when you press '|' it will fill the input field with xargs . You can remove this if you like (^U).
  • For example, if you run xargs -d '\n' -I {} notify-send {} to this it will display notifications containing the data from the current column
  • Useful for:
    • Opening files with a specific application xargs -d \n -I{} mpv {} will open the files in mpv
    • Dumping data. xargs -d \n -I{} echo {} > ~/stuff.txt

Support and Feedback

Feel free to request features. Please report any errors you encounter with appropriate context.

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

listpick-0.1.18.0.tar.gz (96.2 kB view details)

Uploaded Source

Built Distribution

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

listpick-0.1.18.0-py3-none-any.whl (107.7 kB view details)

Uploaded Python 3

File details

Details for the file listpick-0.1.18.0.tar.gz.

File metadata

  • Download URL: listpick-0.1.18.0.tar.gz
  • Upload date:
  • Size: 96.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for listpick-0.1.18.0.tar.gz
Algorithm Hash digest
SHA256 de3eb89f96c4a44475993d9908ac4531d2598221f7cdb7a95689f1ffae82b1af
MD5 46bd7febcd2d7f46bfb1176055e6ae05
BLAKE2b-256 b7360be5f5dff1a65eb98e50b0eb28b354f04ea8a672bb8bfb1ea59c41f62c90

See more details on using hashes here.

File details

Details for the file listpick-0.1.18.0-py3-none-any.whl.

File metadata

  • Download URL: listpick-0.1.18.0-py3-none-any.whl
  • Upload date:
  • Size: 107.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for listpick-0.1.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1de24ff22d6ab4e5d91f2dea8433111e6540465b03925046676f7fcd9fa25fc7
MD5 608e354695ef2cbecd2cebb0d7a403e9
BLAKE2b-256 40ed1b543c751795ab157952ed98ef4a272bfa48e29b16ed6df35733db7a7eb3

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