Skip to main content

A filter with an pointer interface 🦝

Project description

canny creates a clickable pane, based on the standard input.

or more precise:

canny reads lines from STDIN, allowing you to interactively select a value, which is then returned to STDOUT.

example_interaction

  • canny enables interactive filters in piped commands
  • a unix-philosophy experiment
  • brings the mouse to the cli :)
  • a fzf inspired tool

But, what does it do?

  • Every non-white space becomes a token
  • Every token will be possible element for selection
  • After a selection, the token will be returned through standard output

Usage

Here are some examples, after the installation step

This will open the selected file/directory of the current directory in vim:

vim $(ls -C | canny)

Another possible usage is this:

ls -C | canny | xargs xdg-open

This opens the selected file with it's standard application.

For more ways to use canny check out the examples directory.

Html Parser

  • when run with the --tags flag, canny will look for HTML tags (excluding semantics) and makes tag bodies clickable.
  • this function allows for a predefinition of clickable elements, in contrast to the default case, where every non-whitespace character is clickable
  • if the tags are nested, only the highest level of tags is clickable
  • in the case ther are no tags in the text, every word will be tokenized and clickable.

Installation

[!Note] only tested / written for linux

You can install canny from the PyPI repositories using the following command:

pip install canny

or check the realease page for a manual installation.

on ubuntu first install ncurses-term:

apt install ncurses-term

Issues

[!Important] This tool currently supports python3.10 and upwards

On version with a python version lower than 3.10 the curses.BUTTON5 constant is not supported.

Please report possible issues here.

License

This project is licensed under the GPLv3 License.


Made with love by 🦝

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

coating-0.0.1.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

coating-0.0.1-py3-none-any.whl (19.9 kB view hashes)

Uploaded Python 3

Supported by

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