Package: cpick
CURSES LIST PICKERPick items from a list with a nice TUI, & comfy Vi keybindings.INSTALLATIONpip install cpickCLI USAGEUSAGE: cpick:

[-h]        [--help]
[-l LIMIT]  [--limit LIMIT]
[-n]        [--numbers]
[-H HEADER] [--header HEADER]
[-F FOOTER] [--footer FOOTER]
[ITEMS]     [items ...]

Curses List Picker.

Positional Arguments:
  [ITEMS]                : Items for the picker.

Optional Arguments:
  -h, --help             : Show this help message and exit.
  -l, --limit [LIMIT]    : Limit number of picks.
  -n, --numbers          : Show line numbers.
  -H, --header [HEADER]  : A string to use as a header.
  -F, --footer [FOOTER]  : A string to use as a footer.PYTHON USAGEExample using all available argumentsimportcpick# keyword argument dictionarykwargs={# list to feed into the picker'items':['a','list','of','items'],# only allow five items to be picked, defaults to sys.maxsize'limit':5,# turn line numbering on'numbers':True,# defaults to 'PICK ITEMS FROM THIS LIST''header':'My Awesome Custom Header',# defaults to 'Press [?] to view keybindings''footer':'My Awesome Custom Footer',}# splat args using ** to unpack kwargs dictionarypicked=cpick.pick(**kwargs)# print picked listprint(*picked,sep=", ")# output if all items picked: a, list, of, itemsExample using only a list# pass in only mandatory arg - a list.picked=cpick.pick(items=['just','a','list'])print(*picked,sep=", ")# output if all items picked: just, a, listKEYBINDINGSKEYACTIONk,UPMove up one linej,DOWNMove down one lineg,HOMEJump to first lineG,ENDJump to last linef,PGDNJump down a page of linesb,PGUPJump up a page of lines#Jump to line number/Find items via wildcards, regex or rangenJump to next search resultpJump to previous search resultCTRL-nJump to next pickCTRL-pJump to previous pickr,F5Reset search results and picksz,CTRL-lRecenter current line on screenRETPick an item;Pick via wildcards, regex or rangeuUndo the last pickUUndo the last pick and move to it's linetToggle an itemSPCToggle item and go down a lineCTRL-SPCToggle item and go up a lineaToggle all items:Toggle via wildcards, regex or rangevView picked items?,F1View this help pagew,CTRL-sSave picks to a fileq,ESCQuit and display all marked pathsNOTESPicking[;], toggling[:], and searching[/]is supported via the following
methods:Unix Style Wildcards.Regular Expressions.Matching a complete string (ie. not substrings - use wildcards for this.)Specifying the line number of an item.Specifying a range of line numbers in the following forms:PROMPTACTIONx..yMatch line numbers betweenxandyx-yMatch line numbers betweenxandyx..Match line numbers fromxuntil the end of the list..yMatch line numbers from beginning of list untilyx-Match line numbers fromxuntil the end of the list-yMatch line numbers from beginning of list untilyThese can also be combined. You can enter multiple patterns, ranges and strings
at onePick:,Toggle:orFind:prompt.However, be aware, that when toggling - if patterns, ranges or strings are
entered that match the same items, they will cancel each other out.For example, if you entered1..10 ^[A-Z][a-z]+$on a list where the first 10
items were capitalised words, nothing would be picked.The1..10would pick the first ten items, and then the^[A-Z][a-z]+$would
unpick them, since they call the toggle method consecutively.If you do not want this(you probably don't..)- use thePick:prompt
instead.EXAMPLESPick a number from 1 to 100, using custom header/footer and limiting picks to 5.cpick --header "My header" --footer "My footer" --limit 5 {1..100}Pick 5 random words from the dictionary, using the default header/footer.cpick --limit 5 $(shuf -n 100 /usr/share/dict/words)Pick an unlimited number of paths from the current directory.cpick $(ls)