Skip to content

Commit f88edf4

Browse files
authored
Merge pull request #1230 from saulpw/develop
v2.8 release
2 parents 8afbe2f + 3fa5215 commit f88edf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+397
-468
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ jobs:
4343
<<: *test-template
4444
docker:
4545
- image: circleci/python:3.9
46+
47+
test-3.10:
48+
<<: *test-template
49+
docker:
50+
- image: circleci/python:3.10

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
# VisiData version history
22

3+
# 2.8 (2021-12-15)
4+
5+
## Improvements
6+
7+
- [plugins] include pip stderr in warning
8+
- [plugins] use returncode to determine if pip install failed, before adding to imports (thanks @geekscrapy for PR #1215)
9+
- [cmdlog] add sheet creation command to cmdlog (requested by @aborruso #1209)
10+
- [open] strip whitespace from the beginning and end of inputted filenames
11+
- [options] `options.input_history` and `options.cmdlog_histfile` can now be an absolute paths (requested by @geekscrapy #1200)
12+
- relative paths are relative to `options.visidata_dir`
13+
- [splitwin] automatically switch to pane where sheet is pushed to
14+
15+
## Bugfixes
16+
17+
- [curses] suppress invalid color errors in Python 3.10 (thanks @ajkerrigan for reporting #1227 and for PR #1231)
18+
- Adapt to [Python 3.10 curses changes](https://docs.python.org/3/whatsnew/3.10.html#curses) which can raise a `ValueError` on invalid color numbers.
19+
- [curses cosmetic] simplify error message, if curses fails to initialise
20+
- [loaders json] skip blank lines in json files, instead of stopping at them (thanks @geekscrapy for PR #1216)
21+
- [loaders jsonl] fix duplicate columns when loading fixed columns sheets in jsonl format (report by @0ceanlight)
22+
- example of formats with fixed columns is darkdraw's `DrawingSheet`
23+
- [loaders fixed] fix saver (thanks @geekscrapy for PR #1238)
24+
- [loaders postgres] fix recognition of postgres loader (reported by @ryanmjacobs #1229)
25+
- [loaders sqlite] fix the loading of sqlite VIEWs for sqlite version 3.36.0+ (reported by @frosencrantz #1222)
26+
- [help-commands] now lists commands only for the current sheet (reported by @geekscrapy #1217)
27+
- [textcanvas] ENTER on canvas should push copied source sheet for points within cursor
28+
- [pivot freq] use `options.histogram_bins` from source sheet
29+
- [curses cosmetic] fix issue where if a curses initialisation Exception is called, a second Exception follows
30+
- [quit-sheet-free] fix bug where quit-sheet-free, when multiple sheets opened in CLI, was not working (reported by @geekscrapy #1236)
31+
- [options] fix instance where local options sheet was called, instead of global options sheet (thanks @geekscrapy for PR #1241)
32+
33+
## API
34+
35+
- add standard Python `breakpoint()` to drop into the pdb debugger
36+
- export `run()` to global api
37+
- add CsvSheet, ZipSheet, TarSheet to global api (thanks @geekscrapy for PR #1235)
38+
339
# 2.7.1 (2021-11-15)
440

5-
- Bugfix: fix Enter on helmenu (reported by @geekscrapy #1196)
41+
- Bugfix: fix Enter on helpmenu (reported by @geekscrapy #1196)
642

743
# 2.7 (2021-11-14)
844

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# VisiData v2.7.1 [![twitter @VisiData][1.1]][1] [![CircleCI](https://circleci.com/gh/saulpw/visidata/tree/stable.svg?style=svg)](https://circleci.com/gh/saulpw/visidata/tree/stable) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/saulpw/visidata)
2+
# VisiData v2.8 [![twitter @VisiData][1.1]][1] [![CircleCI](https://circleci.com/gh/saulpw/visidata/tree/stable.svg?style=svg)](https://circleci.com/gh/saulpw/visidata/tree/stable) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/saulpw/visidata)
33

44
A terminal interface for exploring and arranging tabular data.
55

dev/checklists/manual-tests.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@
2121
- edit
2222
- frequency table
2323
10. large dataset (311)
24-
11. multiline scrolling tests
25-
- test case 1
26-
- use vgit
27-
- main status sheet is 1 line per row, scroll down manually to the bottom
28-
- and past, ensure it scrolls well
29-
- and then scroll to the top, and make sure it scrolls back
30-
- test case 2
31-
- start a few down from the top
32-
- Ctrl+F
33-
- make sure the cursor stays relatively positioned
34-
- Ctrl+F and Ctrl+B should be reserves, at least in the middle of the sheet
35-
- and then all the way to the bottom; j does nothing
36-
- gj always puts the cursor on the bottom row
37-
- test case 3
38-
- Shift+L for log, same tests
3924
12. Options
4025
- local + global options should be set appropriately
4126
- bin/vd -f tsv sample_data/sample.tsv -f csv sample_data/benchmark.csv
@@ -58,7 +43,7 @@
5843
- -f should apply to inner file for zipped filetypes
5944
- bin/vd -f txt sample_data/y77d-th95.json.gz
6045
14. Testing the starting position syntax
61-
- `bin/vd +:sample-salesv4:: sample_data/sample-sales-reps.xlsx`
46+
- `bin/vd +:sample-salesv4:2:3 sample_data/sample-sales-reps.xlsx`
6247
15. Test loading url
6348
16. Split window
6449
- make sure that if you exit split window, all the sheets from both panes can be accessible on the resulting stack
@@ -68,9 +53,6 @@
6853
- first window should be active
6954
- Tab between
7055
- close top one, then redo and test closing bottom one
71-
- bug?
72-
- does not fullsize
73-
- when top pane is quit, bottom pane is moved to the top
7456
- test 2
7557
- open 2 files
7658
- Z

docs/assets/longname.png

178 KB
Loading

docs/columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Command Type
5656
`z#` vlen
5757
`z~` anytype
5858

59-
Columns usually begin as untyped. Odd results while working with numerical or datetime data is usually due to values being considered as strings, and the problem is solved by setting the correct type.
59+
Columns usually begin as untyped (`anytype`). Errors when working with numerical or datetime data is often due to values being considered as strings, and the problem is solved by setting the correct type.
6060

6161
The `float` type uses Python's builtin `float()` constructor to parse the string, and it parses by using the decimal separator.
6262

docs/crud.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,15 @@
22
eleventyNavigation:
33
key: Creating sheets, rows and columns
44
order: 8
5-
Update: 2018-12-12
6-
Version: VisiData 1.5.1
5+
Update: 2021-11-18
6+
Version: VisiData 2.7.1
77
---
88

99

1010

11-
## How to configure the cursor to move right after a successful edit
12-
13-
1. Press `Shift+O` to enter the global options menu.
14-
2. Type `r` followed by `cmd` to move the cursor to the **cmd\_after\_edit** option.
15-
3. Press `Enter` to edit the option, and type `go-right`. Press `Enter` to save the option.
16-
17-
**or**
18-
19-
1. To have the change [persist](/docs/customize), add the following line to the .visidatarc.
20-
21-
options.cmd_after_edit='go-right'
22-
23-
---
24-
2511
## How to set up a sheet for data collection
2612

27-
1. Type `Shift+A` followed by a *number* to open a new blank sheet with that many columns.
13+
1. Type `Shift+A` to open a new blank sheet with one column.
2814
2. Press
2915

3016
a. `a` to add one blank row.
@@ -33,10 +19,6 @@ Version: VisiData 1.5.1
3319

3420
b. `ga` followed by a *number* to add that many blank rows.
3521

36-
3. [Edit the cells](/docs/edit) in any row to contain the column names.
37-
4. While the cursor is on that row, press `g^` to set the header for each column with the contents of the row.
38-
5. Press `d` to remove that row.
39-
4022
---
4123

4224
## How to add a new blank column
@@ -49,12 +31,27 @@ Version: VisiData 1.5.1
4931

5032
b. `gza` followed by a *number* to add that many blank columns.
5133

34+
2. Press `^` to edit the column name.
35+
5236
---
5337

5438
## How to fill a column with a range of numbers
5539

56-
1. Optional: Use `s` or `t` to select a subset of rows to fill.
57-
2. Move the cursor to the column.
58-
3. Type `gz=` followed by `range(`*n*`)` to set selected rows in that column to the results of an iterator expression. In this case, the range of numbers from 1 to *n*.
40+
1. Press `gs` to select all rows (or use other commands to select a subset of rows to fill).
41+
2. Move the cursor to the column to be filled.
42+
3. Press `gi`.
43+
44+
## How to edit a cell
45+
46+
1. Press `e` to edit an individual cell.
47+
2. Type in the new value.
48+
3. Press `Enter` to accept the value.
49+
50+
---
51+
52+
## How to move the cursor to the next cell after a successful edit
53+
54+
1. Press `Shift+Arrow` to accept the current value and move the cursor into edit mode in the next cell.
5955

6056
---
57+

docs/customize.md

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,25 @@
22
eleventyNavigation:
33
key: Customizing VisiData
44
order: 12
5-
Updated: 2019-11-02
6-
Version: VisiData v2.-1
5+
Updated: 2021-11-18
6+
Version: VisiData v2.7
77
---
88

9-
In VisiData, there is a distinction between global configurations (options/commands) and sheet-specific. Global settings are on default applied to every single sheet in the session. Sheet-specific ones override global settings for a given **SheetType**.
10-
11-
Examples of **SheetType**s include (but are not limited to):
12-
13-
* **FreqTableSheet** (the command is executable on every [frequency table](/docs/group#frequency));
14-
* **TsvSheet** (option is applied to every loaded .tsv file);
15-
* **ColumnsSheet** (typing selected referenced columns with `g#` can only be done on the **Columns sheet**).
16-
17-
## How to configure VisiData within the current session
18-
19-
Within the application itself:
20-
21-
* Press `z Shift+O` to access the **Options sheet** for the current **SheetType**.
22-
* Press `Shift+O` to access the global **Options sheet**.
23-
24-
An option can be edited either by pressing `Enter` or by using [standard editing commands](/man#edit).
25-
26-
Global options can also be passed as arguments through the [commandline](/man#options). For example
27-
28-
~~~
29-
vd --skip 2
30-
~~~
31-
32-
or
33-
34-
~~~
35-
vd --skip=2
36-
~~~
37-
38-
---
39-
40-
## How to have setting configurations persist
41-
42-
The contents of **.visidatarc** in the user's home directory (and also the current directory) are `exec()`d on startup. Options set through the command-line or **Options Sheet** will override those set in **.visidatarc**.
43-
44-
To set the global value of an option:
45-
46-
~~~
47-
options.num_burgers = 13
48-
~~~
49-
50-
The type of the default is respected. An **Exception** will be raised if the option is later set with a value that cannot be converted. (A default value of **None** will allow any type.)
51-
52-
Option names should use the underscore for word breaks. On the command-line, underscores must be converted to dashes:
53-
54-
~~~
55-
$ vd --num-burgers=23
56-
~~~
57-
58-
The maximum option name length should be 20.
59-
60-
`theme()` should be used instead of `option()` if the option has no effect on the operation of the program, and can be overrided without affecting existing scripts. The interfaces are identical. (The implementation is also identical currently, but that may change in the future.)
61-
62-
To generate a `.visidatarc` with all of the global options as they are currently set:
63-
- `Shift+O` to go to any Options Sheet
64-
- `Ctrl+S` and save to a file with a `.visidatarc` extension
65-
66-
67-
:::::
68-
69-
---
9+
For a primer on configuring VisiData through setting options, see [jsvine's tutorial](https://jsvine.github.io/intro-to-visidata/advanced/configuring-visidata/).
7010

7111
## How to configure commands {#commands}
7212

7313
The **.visidatarc** in the user's home directory is plain Python code, and can contain additional commands or key bindings.
7414

75-
Longnames are names given to particular flavours of executable commands for ease of keystroke remapping. For example, the longname `select-row` is assigned to commands which select the current row in a sheet. On default, this longname is bound to the keystroke `s`.
15+
Longnames are names given to executable commands for ease of keystroke remapping. For example, the longname `select-row` is assigned to commands which select the current row in a sheet. On default, this longname is bound to the keystroke `s`.
7616

77-
From within VisiData, type `z Ctrl+H` to open the **Commands Sheet**. This is a reference for all of the commands available on the current sheet. For a deeper exploration of commands, check out [the book of VisiData](https://www.visidata.org/docs/api/commands.html).
17+
From within VisiData, type `z Ctrl+H` to open the **Commands Sheet**. This is a reference for all of the commands available on the current sheet. For a deeper exploration of commands, check out [API reference manual](https://www.visidata.org/docs/api/commands.html).
7818

7919
### Setting/changing keybindings for existing commands
8020

81-
1. Use `z Ctrl+H` to open the **Commands Sheet** and discover the [longname]() for the functionality in question.
21+
1. Learn the longname for a command. Longnames are usually 2-3 words, seperated by hyphens. The first word is usually a verb, and the second usually a noun. When a command is executed, its longname appears in the lower right status, next to its keystroke. Alternatively, you can `z Ctrl+H` to open the **Commands Sheet** and discover the longname for the command in question.
22+
23+
![longname](/docs/assets/longname.png)
8224

8325
2. a) To create a global keybinding, add `bindkey(keystroke, longname)` to your **.visidatarc**.
8426
b) To set the binding for a particular sheet type, add `<Sheet>.bindkey(keystroke, longname)` to your **.visidatarc**, where `<Sheet>` is a **SheetType**.
@@ -98,39 +40,17 @@ In VisiData, pressing `e` enters edit mode for the current cell. Seasoned vim us
9840

9941
### Creating new commands
10042

101-
Both `globalCommand` and `<Sheet>.addCommand` take the same parameters. At minimum, each command requires a longname and execstr.
102-
103-
~~~
104-
globalCommand(default_keybinding, longname, execstr)
105-
~~~
43+
At minimum, `<Sheet>.addCommand` requires a longname and execstr.
10644

107-
For example, to define a new global command:
108-
109-
~~~
110-
globalCommand('^D', 'scroll-halfpage-down', 'cursorDown(nScreenRows//2); sheet.topRowIndex += nScreenRows//2')
111-
~~~
112-
113-
For a sheet-specific command:
114-
115-
~~~
116-
<Sheet>.addCommand('^D', 'scroll-halfpage-down', 'cursorDown(nScreenRows//2); sheet.topRowIndex += nScreenRows//2')
117-
~~~
118-
119-
where `<Sheet>` is a particular **Sheet Type**.
120-
121-
Note that sheet-specific commands trump globally set commands for keybindings.
122-
123-
`globalCommand` is primarily for commands which don't need a sheet at all. In most cases, commands should be on `Sheet` or a further specialised **Sheet Type**.
45+
For example, to define a new command:
12446

12547
~~~
12648
Sheet.addCommand('^D', 'scroll-halfpage-down', 'cursorDown(nScreenRows//2); sheet.topRowIndex += nScreenRows//2')
12749
~~~
12850

129-
`execstr` is resolved recursively, so it can be an existing keystroke or `longname` for those that have one. The last in the chain is `exec()`ed.
130-
131-
---
51+
Commands and keybindings are set on a particular Sheet Type in the class hierarchy. Use `BaseSheet` for commands which don't need a sheet at all--these will apply to all sheets. Commands and bindings on more specific sheets will override more generic ones. `Sheet` is a generic table, `ColumnsSheet` would be for the columns sheet, `FreqTableSheet` for frequency tables, and so on.
13252

133-
### Adding custom aggregators
53+
### Adding custom aggregators {#aggregators}
13454

13555
Aggregators allow you to gather the rows within a single column, and interpret them using descriptive statistics. VisiData comes pre-loaded with a default set like mean, stdev, and sum.
13656

0 commit comments

Comments
 (0)