visidata 3.1__py3-none-any.whl → 3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- visidata/__init__.py +2 -2
- visidata/_input.py +70 -36
- visidata/_open.py +9 -6
- visidata/_types.py +2 -2
- visidata/aggregators.py +125 -16
- visidata/apps/vdsql/_ibis.py +8 -13
- visidata/basesheet.py +4 -1
- visidata/canvas.py +11 -7
- visidata/clipboard.py +11 -2
- visidata/cliptext.py +65 -23
- visidata/cmdlog.py +5 -1
- visidata/column.py +6 -2
- visidata/ddwplay.py +2 -2
- visidata/deprecated.py +91 -63
- visidata/errors.py +41 -5
- visidata/{features → experimental}/helloworld.py +1 -1
- visidata/expr.py +1 -0
- visidata/extensible.py +4 -0
- visidata/features/cmdpalette.py +3 -3
- visidata/features/describe.py +2 -2
- visidata/features/expand_cols.py +8 -5
- visidata/features/freeze.py +14 -2
- visidata/features/go_col.py +2 -1
- visidata/features/graph_zoom_y.py +47 -0
- visidata/features/incr.py +7 -3
- visidata/features/join.py +23 -12
- visidata/features/layout.py +8 -3
- visidata/features/melt.py +1 -0
- visidata/features/rank.py +103 -0
- visidata/features/reload_every.py +9 -6
- visidata/features/sysedit.py +14 -4
- visidata/features/transpose.py +1 -0
- visidata/features/window.py +12 -0
- visidata/form.py +4 -4
- visidata/freqtbl.py +47 -3
- visidata/fuzzymatch.py +8 -5
- visidata/graph.py +5 -3
- visidata/guides/AggregatorsSheet.md +84 -0
- visidata/guides/MacrosSheet.md +1 -1
- visidata/guides/RankGuide.md +51 -0
- visidata/guides/TypesSheet.md +1 -1
- visidata/guides/WindowFunctionGuide.md +49 -0
- visidata/help.py +3 -4
- visidata/indexsheet.py +1 -1
- visidata/loaders/_pandas.py +3 -1
- visidata/loaders/archive.py +6 -3
- visidata/loaders/csv.py +5 -1
- visidata/loaders/eml.py +2 -0
- visidata/loaders/f5log.py +2 -2
- visidata/loaders/fec.py +6 -9
- visidata/loaders/fixed_width.py +2 -0
- visidata/loaders/hdf5.py +34 -10
- visidata/loaders/npy.py +54 -23
- visidata/loaders/orgmode.py +3 -2
- visidata/loaders/pandas_freqtbl.py +4 -0
- visidata/loaders/psv.py +13 -0
- visidata/loaders/sqlite.py +1 -1
- visidata/loaders/vds.py +3 -4
- visidata/macros.py +4 -3
- visidata/main.py +11 -5
- visidata/mainloop.py +7 -4
- visidata/man/parse_options.py +3 -2
- visidata/man/vd.1 +26 -14
- visidata/man/vd.txt +25 -14
- visidata/menu.py +9 -9
- visidata/metasheets.py +3 -3
- visidata/mouse.py +1 -0
- visidata/pyobj.py +17 -9
- visidata/save.py +5 -1
- visidata/selection.py +29 -18
- visidata/settings.py +2 -2
- visidata/sheets.py +52 -24
- visidata/shell.py +2 -2
- visidata/sidebar.py +4 -2
- visidata/sort.py +89 -11
- visidata/statusbar.py +10 -9
- visidata/tests/test_cliptext.py +151 -0
- visidata/tests/test_commands.py +5 -2
- visidata/tests/test_menu.py +1 -1
- visidata/textsheet.py +34 -8
- visidata/themes/ascii8.py +2 -2
- visidata/themes/light.py +5 -0
- visidata/threads.py +16 -8
- visidata/undo.py +1 -1
- {visidata-3.1.data → visidata-3.2.data}/data/share/man/man1/vd.1 +26 -14
- {visidata-3.1.data → visidata-3.2.data}/data/share/man/man1/visidata.1 +26 -14
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/METADATA +62 -15
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/RECORD +95 -93
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/WHEEL +1 -1
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/entry_points.txt +1 -0
- visidata/features/errors_guide.py +0 -26
- visidata/loaders/api_bitio.py +0 -102
- visidata/stored_prop.py +0 -38
- visidata-3.1.data/scripts/vd +0 -6
- /visidata/{guides/SortGuide.md → vendor/__init__.py} +0 -0
- {visidata-3.1.data → visidata-3.2.data}/data/share/applications/visidata.desktop +0 -0
- {visidata-3.1.data → visidata-3.2.data}/scripts/vd2to3.vdx +0 -0
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/LICENSE.gpl3 +0 -0
- {visidata-3.1.dist-info → visidata-3.2.dist-info}/top_level.txt +0 -0
@@ -1,26 +0,0 @@
|
|
1
|
-
from visidata import GuideSheet, vd
|
2
|
-
|
3
|
-
class ErrorsGuide(GuideSheet):
|
4
|
-
guide_text='''# What was that error?
|
5
|
-
|
6
|
-
Status messages include [:warning]warnings[/] and [:error]errors[/].
|
7
|
-
|
8
|
-
A command may issue a [:warning]warning[/] status and continue running.
|
9
|
-
A command that [:warning]fails[/] or [:error]errors[/] is aborted.
|
10
|
-
|
11
|
-
## Investigating errors further
|
12
|
-
|
13
|
-
If a Python Exception like [:error]RuntimeError[/] appears in the sidebar:
|
14
|
-
|
15
|
-
- {help.commands.error_recent}
|
16
|
-
- {help.commands.errors_all}
|
17
|
-
|
18
|
-
If [:note_type]{vd.options.note_format_exc}[/] or [:error]{vd.options.note_getter_exc}[/] appear inside a cell, it indicates an error happened during calculation, type-conversion, or formatting. When the cursor is on an error cell:
|
19
|
-
|
20
|
-
- {help.commands.error_cell}
|
21
|
-
'''
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
vd.addGuide('ErrorsSheet', ErrorsGuide)
|
26
|
-
|
visidata/loaders/api_bitio.py
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
|
2
|
-
from visidata import *
|
3
|
-
|
4
|
-
vd.option('bitio_api_key', '', 'API key')
|
5
|
-
|
6
|
-
@VisiData.api
|
7
|
-
def new_bitio(vd, p):
|
8
|
-
vd.importExternal('bitdotio')
|
9
|
-
vd.requireOptions('bitio_api_key', help='https://docs.bit.io/docs/connecting-via-the-api')
|
10
|
-
return BitioReposSheet(p.name, source=p)
|
11
|
-
|
12
|
-
vd.openhttp_bitio = vd.new_bitio
|
13
|
-
|
14
|
-
@VisiData.lazy_property
|
15
|
-
def bitio_client(vd):
|
16
|
-
import bitdotio
|
17
|
-
return bitdotio.bitdotio(vd.options.bitio_api_key)
|
18
|
-
|
19
|
-
@VisiData.api
|
20
|
-
def bitio_api(vd, path, method, **kwargs):
|
21
|
-
t = vd.bitio_client.api_client.call_api(path, method,
|
22
|
-
header_params={'Accept': 'application/json',
|
23
|
-
'Authorization': 'Bearer '+vd.bitio_client.access_token,
|
24
|
-
'Content-Type': 'application/json'}, async_req=True, body=kwargs)
|
25
|
-
if not t.successful():
|
26
|
-
vd.warning(resp['Reason'])
|
27
|
-
return t.get()
|
28
|
-
|
29
|
-
|
30
|
-
class BitioReposSheet(Sheet):
|
31
|
-
rowtype = 'repos'
|
32
|
-
columns = [
|
33
|
-
AttrColumn('name'),
|
34
|
-
AttrColumn('creator'),
|
35
|
-
AttrColumn('owner'),
|
36
|
-
AttrColumn('bytes', type=int, width=0),
|
37
|
-
AttrColumn('collaborators'),
|
38
|
-
AttrColumn('description'),
|
39
|
-
AttrColumn('documentation'),
|
40
|
-
AttrColumn('endpoints'),
|
41
|
-
AttrColumn('is_private'),
|
42
|
-
AttrColumn('license'),
|
43
|
-
AttrColumn('query_count'),
|
44
|
-
AttrColumn('stars'),
|
45
|
-
AttrColumn('tables'),
|
46
|
-
AttrColumn('url'),
|
47
|
-
AttrColumn('watchers'),
|
48
|
-
]
|
49
|
-
defer = True
|
50
|
-
def iterload(self):
|
51
|
-
yield from vd.bitio_client.list_repos(self.source.name)
|
52
|
-
|
53
|
-
|
54
|
-
@asyncthread
|
55
|
-
def putChanges(self):
|
56
|
-
adds, mods, dels = self.getDeferredChanges()
|
57
|
-
for row in dels.values():
|
58
|
-
vd.bitio_api(f'/users/{self.source.name}/repos/{row.name}/', 'DELETE')
|
59
|
-
|
60
|
-
for row, rowmods in Progress(list(mods.values()), gerund="updating"):
|
61
|
-
kwargs = {col.name: val for col, val in rowmods.items()}
|
62
|
-
vd.bitio_api(f'/users/{self.source.name}/repos/{row.name}/', 'PATCH', **kwargs)
|
63
|
-
|
64
|
-
def openRow(self, row):
|
65
|
-
return BitioRepoSheet(self.source.name, row.name, source=row)
|
66
|
-
|
67
|
-
|
68
|
-
class BitioRepoSheet(Sheet):
|
69
|
-
rowtype = 'tables'
|
70
|
-
columns = [
|
71
|
-
AttrColumn('url'),
|
72
|
-
AttrColumn('current_name'),
|
73
|
-
AttrColumn('description'),
|
74
|
-
AttrColumn('columns'),
|
75
|
-
AttrColumn('num_records', type=int),
|
76
|
-
AttrColumn('bytes', type=int),
|
77
|
-
AttrColumn('repo'),
|
78
|
-
AttrColumn('documentation'),
|
79
|
-
]
|
80
|
-
def iterload(self):
|
81
|
-
yield from vd.bitio_client.list_tables(self.source.owner.split('/')[-2], self.source.name)
|
82
|
-
|
83
|
-
def openRow(self, row):
|
84
|
-
username = row.repo.split('/')[-4]
|
85
|
-
repo = row.repo.split('/')[-2]
|
86
|
-
return BitioTable(username, repo, source=row)
|
87
|
-
|
88
|
-
|
89
|
-
class BitioTable(Sheet):
|
90
|
-
def iterload(self):
|
91
|
-
username = self.source.repo.split('/')[-4]
|
92
|
-
repo = self.source.repo.split('/')[-2]
|
93
|
-
conn = vd.bitio_client.get_connection()
|
94
|
-
with conn.cursor() as cur:
|
95
|
-
cur.execute(f'SELECT * FROM "{username}/{repo}"."{self.source.current_name}"')
|
96
|
-
r = cur.fetchone()
|
97
|
-
if r:
|
98
|
-
yield r
|
99
|
-
self.columns = []
|
100
|
-
for c in vd.postgresGetColumns(cur):
|
101
|
-
self.addColumn(c)
|
102
|
-
yield from cur
|
visidata/stored_prop.py
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
from functools import wraps
|
2
|
-
import json
|
3
|
-
import atexit
|
4
|
-
|
5
|
-
from visidata import vd, VisiData, Path
|
6
|
-
|
7
|
-
vd.stored_properties = {}
|
8
|
-
|
9
|
-
@VisiData.class_api
|
10
|
-
@classmethod
|
11
|
-
def stored_property(vdcls, f):
|
12
|
-
def _save_on_exit():
|
13
|
-
if vd.stored_properties.get(f, None):
|
14
|
-
p = Path(vd.options.visidata_dir)/(f.__name__ + '.json')
|
15
|
-
with p.open(mode='w', encoding='utf-8') as fp:
|
16
|
-
fp.write(json.dumps(vd.stored_properties[f]))
|
17
|
-
|
18
|
-
@property
|
19
|
-
@wraps(f)
|
20
|
-
def _decorator(*args, **kwargs):
|
21
|
-
'Read persisted value from filesystem if available; otherwise call the decorated function to create a new instance.'
|
22
|
-
value = vd.stored_properties.get(f, None)
|
23
|
-
if value is not None:
|
24
|
-
return value
|
25
|
-
|
26
|
-
p = Path(vd.options.visidata_dir)/(f.__name__ + '.json')
|
27
|
-
if p.exists():
|
28
|
-
value = json.loads(p.open(encoding='utf-8-sig').read())
|
29
|
-
|
30
|
-
if value is None:
|
31
|
-
value = f(*args, **kwargs)
|
32
|
-
|
33
|
-
vd.stored_properties[f] = value
|
34
|
-
return value
|
35
|
-
|
36
|
-
atexit.register(_save_on_exit)
|
37
|
-
setattr(vdcls, f.__name__, _decorator)
|
38
|
-
return _decorator
|
visidata-3.1.data/scripts/vd
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|