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.
Files changed (99) hide show
  1. visidata/__init__.py +2 -2
  2. visidata/_input.py +70 -36
  3. visidata/_open.py +9 -6
  4. visidata/_types.py +2 -2
  5. visidata/aggregators.py +125 -16
  6. visidata/apps/vdsql/_ibis.py +8 -13
  7. visidata/basesheet.py +4 -1
  8. visidata/canvas.py +11 -7
  9. visidata/clipboard.py +11 -2
  10. visidata/cliptext.py +65 -23
  11. visidata/cmdlog.py +5 -1
  12. visidata/column.py +6 -2
  13. visidata/ddwplay.py +2 -2
  14. visidata/deprecated.py +91 -63
  15. visidata/errors.py +41 -5
  16. visidata/{features → experimental}/helloworld.py +1 -1
  17. visidata/expr.py +1 -0
  18. visidata/extensible.py +4 -0
  19. visidata/features/cmdpalette.py +3 -3
  20. visidata/features/describe.py +2 -2
  21. visidata/features/expand_cols.py +8 -5
  22. visidata/features/freeze.py +14 -2
  23. visidata/features/go_col.py +2 -1
  24. visidata/features/graph_zoom_y.py +47 -0
  25. visidata/features/incr.py +7 -3
  26. visidata/features/join.py +23 -12
  27. visidata/features/layout.py +8 -3
  28. visidata/features/melt.py +1 -0
  29. visidata/features/rank.py +103 -0
  30. visidata/features/reload_every.py +9 -6
  31. visidata/features/sysedit.py +14 -4
  32. visidata/features/transpose.py +1 -0
  33. visidata/features/window.py +12 -0
  34. visidata/form.py +4 -4
  35. visidata/freqtbl.py +47 -3
  36. visidata/fuzzymatch.py +8 -5
  37. visidata/graph.py +5 -3
  38. visidata/guides/AggregatorsSheet.md +84 -0
  39. visidata/guides/MacrosSheet.md +1 -1
  40. visidata/guides/RankGuide.md +51 -0
  41. visidata/guides/TypesSheet.md +1 -1
  42. visidata/guides/WindowFunctionGuide.md +49 -0
  43. visidata/help.py +3 -4
  44. visidata/indexsheet.py +1 -1
  45. visidata/loaders/_pandas.py +3 -1
  46. visidata/loaders/archive.py +6 -3
  47. visidata/loaders/csv.py +5 -1
  48. visidata/loaders/eml.py +2 -0
  49. visidata/loaders/f5log.py +2 -2
  50. visidata/loaders/fec.py +6 -9
  51. visidata/loaders/fixed_width.py +2 -0
  52. visidata/loaders/hdf5.py +34 -10
  53. visidata/loaders/npy.py +54 -23
  54. visidata/loaders/orgmode.py +3 -2
  55. visidata/loaders/pandas_freqtbl.py +4 -0
  56. visidata/loaders/psv.py +13 -0
  57. visidata/loaders/sqlite.py +1 -1
  58. visidata/loaders/vds.py +3 -4
  59. visidata/macros.py +4 -3
  60. visidata/main.py +11 -5
  61. visidata/mainloop.py +7 -4
  62. visidata/man/parse_options.py +3 -2
  63. visidata/man/vd.1 +26 -14
  64. visidata/man/vd.txt +25 -14
  65. visidata/menu.py +9 -9
  66. visidata/metasheets.py +3 -3
  67. visidata/mouse.py +1 -0
  68. visidata/pyobj.py +17 -9
  69. visidata/save.py +5 -1
  70. visidata/selection.py +29 -18
  71. visidata/settings.py +2 -2
  72. visidata/sheets.py +52 -24
  73. visidata/shell.py +2 -2
  74. visidata/sidebar.py +4 -2
  75. visidata/sort.py +89 -11
  76. visidata/statusbar.py +10 -9
  77. visidata/tests/test_cliptext.py +151 -0
  78. visidata/tests/test_commands.py +5 -2
  79. visidata/tests/test_menu.py +1 -1
  80. visidata/textsheet.py +34 -8
  81. visidata/themes/ascii8.py +2 -2
  82. visidata/themes/light.py +5 -0
  83. visidata/threads.py +16 -8
  84. visidata/undo.py +1 -1
  85. {visidata-3.1.data → visidata-3.2.data}/data/share/man/man1/vd.1 +26 -14
  86. {visidata-3.1.data → visidata-3.2.data}/data/share/man/man1/visidata.1 +26 -14
  87. {visidata-3.1.dist-info → visidata-3.2.dist-info}/METADATA +62 -15
  88. {visidata-3.1.dist-info → visidata-3.2.dist-info}/RECORD +95 -93
  89. {visidata-3.1.dist-info → visidata-3.2.dist-info}/WHEEL +1 -1
  90. {visidata-3.1.dist-info → visidata-3.2.dist-info}/entry_points.txt +1 -0
  91. visidata/features/errors_guide.py +0 -26
  92. visidata/loaders/api_bitio.py +0 -102
  93. visidata/stored_prop.py +0 -38
  94. visidata-3.1.data/scripts/vd +0 -6
  95. /visidata/{guides/SortGuide.md → vendor/__init__.py} +0 -0
  96. {visidata-3.1.data → visidata-3.2.data}/data/share/applications/visidata.desktop +0 -0
  97. {visidata-3.1.data → visidata-3.2.data}/scripts/vd2to3.vdx +0 -0
  98. {visidata-3.1.dist-info → visidata-3.2.dist-info}/LICENSE.gpl3 +0 -0
  99. {visidata-3.1.dist-info → visidata-3.2.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.37.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
+ vd = visidata.main:vd_cli
2
3
  visidata = visidata.main:vd_cli
@@ -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
-
@@ -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
@@ -1,6 +0,0 @@
1
- #!python
2
-
3
- import visidata.main
4
-
5
- if __name__ == '__main__':
6
- visidata.main.vd_cli()
File without changes