Extending VisiData With Plugins¶
VisiData allows users to extend the program’s functionality through plugins. You can write your own, or use plugins other people have written. This chapter focuses on incorporating already-written plugins.
Using VisiData’s plugin installer¶
VisiData provides an interface for installing certain plugins. To open the interface, press Space to raise the longname-command prompt, type
open-plugins, and press Enter:
name ║ instal…| description | maintainer | latest_releas> vfake ║ | replace column with fake values | Saul Pwanson @saul…| 2020-10-06 dedupe ║ | adds commands for selection and remova…| Jeremy Singer-Vine…| 2020-10-11 normcol ║ | normalizes column names in any given s…| Jeremy Singer-Vine…| 2020-10-11 fec ║ | loader for .fec files from the Federal…| Jeremy Singer-Vine…| 2019-04-21 sparkline ║ | add a sparkline column to visualise tr…| Lucas Messenger @l…| 2020-09-13 rownum ║ | add column of original row ordering | Saul Pwanson @saul…| 2019-11-07 vmailcap ║ | add mailcap-view(-selected) commands t…| Saul Pwanson @saul…| 2020-10-06 vmutagen ║ | add mp3 metadata columns to DirSheet | Saul Pwanson @saul…| 2019-09-25 vds3 ║ | add support for Amazon S3 paths | AJ Kerrigan @ajker…| 2020-10-10 genericSQL ║ | add loaders for SQL databases (Oracle,…| Andrew Swanson @as…| 2020-04-15 diff ║ | adds command to create diff sheets | Anja Kefala @anjak…| 2020-10-09 marks ║ | adds commands for marking selected row…| Saul Pwanson @saul…| 2020-10-09 conll ║ | CoNLL data loader | Paul McCann <polm@…| 2020-12-07 3› plugins_global| "open-plugins" 13 plugins
To install and activate any of these plugins, navigate to its row and press a. To deactivate a plugin, navigate to its row and press d.
How to install a plugin manually¶
You can also manually install plugins that are not available through the installer. Doing so involves two steps:
- First, make the plugin available to VisiData. Depending on the plugin, you’ll do this either by saving the plugin file to your
~/.visidata/directory, or by running
pip install [plugin_package_name].
- Then, use your
~/.visidatarcconfiguration file to import the plugin. If you’ve saved your plugin as
~/.visidata/myplugin.py, all you need to do is add a line that says
To demonstrate, let’s install a “dedupe” plugin:
- Open this file in your browser and save it to
~/.visidata/dedupe.pyon your computer.
- Open your
import dedupeon a new line, and save the file.
That’s it. Next time you start VisiData, you should have access to two new commands:
Let’s give the plugin a spin. Download
dedupe-example.csv and open it in VisiData:
You should see this:
animal | name ║ dog | Apollo ║ dog | Bambi ║ dog | Cutie ║ fish | Fido ║ fish | Fido ║ 1› dedupe-example| user_macros | saul.pw/VisiData v2.1 | opening datasets/dedupe 5 rows
Press Space to initiate the longname-command prompt, and type
animal | name ║ dog | Apollo ║ dog | Bambi ║ dog | Cutie ║ fish | Fido ║ fish | Fido ║ command name: dedupe-rows exec-longname 5 rows
Press Enter to execute the command. Now you should see a new copy of the sheet, but with the duplicate row removed:
animal | name ║ dog | Apollo ║ dog | Bambi ║ dog | Cutie ║ fish | Fido ║ 2› dedupe-example_deduped| No key cols specified. Using all columns. | "dedupe- 4 rows
Where to find plugins¶
Plugin support is a relatively new feature of VisiData, so there aren’t many public plugins yet available. Here is a (likely incomplete) list of resources:
As with any software you download, plugins may contain malicious code. If you’re unsure whether a plugin is safe to install, err on the side of caution.