TSVZ 3.28__py3-none-any.whl → 3.29__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.
TSVZ.py CHANGED
@@ -22,10 +22,10 @@ if os.name == 'nt':
22
22
  elif os.name == 'posix':
23
23
  import fcntl
24
24
 
25
- version = '3.28'
25
+ version = '3.29'
26
26
  __version__ = version
27
27
  author = 'pan@zopyr.us'
28
- COMMIT_DATE = '2025-07-07'
28
+ COMMIT_DATE = '2025-08-11'
29
29
 
30
30
  DEFAULT_DELIMITER = '\t'
31
31
  DEFAULTS_INDICATOR_KEY = '#_defaults_#'
@@ -885,6 +885,29 @@ def scrubTabularFile(fileName,teeLogger = None,header = '',createIfNotExist = Fa
885
885
  appendLinesTabularFile(fileName,file,teeLogger = teeLogger,header = header,createIfNotExist = createIfNotExist,verifyHeader = verifyHeader,verbose = verbose,encoding = encoding,strict = strict,delimiter = delimiter)
886
886
  return file
887
887
 
888
+ def getListView(tsvzDic,header = [],delimiter = DEFAULT_DELIMITER):
889
+ if header:
890
+ if isinstance(header,str):
891
+ header = header.split(delimiter)
892
+ elif not isinstance(header,list):
893
+ try:
894
+ header = list(header)
895
+ except:
896
+ header = []
897
+ if not tsvzDic:
898
+ if not header:
899
+ return []
900
+ else:
901
+ return [header]
902
+ if not header:
903
+ return list(tsvzDic.values())
904
+ else:
905
+ values = list(tsvzDic.values())
906
+ if values[0] and values[0] == header:
907
+ return values
908
+ else:
909
+ return [header] + values
910
+
888
911
  # create a tsv class that functions like a ordered dictionary but will update the file when modified
889
912
  class TSVZed(OrderedDict):
890
913
  def __teePrintOrNot(self,message,level = 'info'):
@@ -1105,6 +1128,9 @@ class TSVZed(OrderedDict):
1105
1128
  self.__teePrintOrNot(f"Appending {emptyLine} to the appendQueue")
1106
1129
  self.appendQueue.append(emptyLine)
1107
1130
  return self
1131
+
1132
+ def getListView(self):
1133
+ return getListView(self,header=self.header,delimiter=self.delimiter)
1108
1134
 
1109
1135
  def clear(self):
1110
1136
  # clear the dictionary and update the file
@@ -1539,6 +1565,3 @@ def __main__():
1539
1565
  print("Invalid operation")
1540
1566
  if __name__ == '__main__':
1541
1567
  __main__()
1542
-
1543
-
1544
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TSVZ
3
- Version: 3.28
3
+ Version: 3.29
4
4
  Summary: An simple in memory wrapper around a TSV file to function as a database
5
5
  Home-page: https://github.com/yufei-pan/TSVZ
6
6
  Author: Yufei Pan
@@ -0,0 +1,6 @@
1
+ TSVZ.py,sha256=mULdGJvv_LcO4bGGRWjg-esutV3EahLywvRa6oRkynQ,78467
2
+ tsvz-3.29.dist-info/METADATA,sha256=kS1cnrQ2wyqj5qVhnVlbCSjdWLeJkhbPqLwFnDX-QpY,1826
3
+ tsvz-3.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ tsvz-3.29.dist-info/entry_points.txt,sha256=WeXidyV5yKCRLaVsnAY35xGa08QgytOfvr1CK9aescI,60
5
+ tsvz-3.29.dist-info/top_level.txt,sha256=OPx4LvOpaYykaos7oL_jGaObSWXxLzhHiWLuz-K147g,5
6
+ tsvz-3.29.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- TSVZ.py,sha256=HWooYlke-QDgcX5KbE0j8QJB1hH0ttb7t13ZILuoIbA,77718
2
- tsvz-3.28.dist-info/METADATA,sha256=eceR8HsdOc71TCXrUKk89IK4-kOEZIHxGqTvt40_Q88,1826
3
- tsvz-3.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- tsvz-3.28.dist-info/entry_points.txt,sha256=WeXidyV5yKCRLaVsnAY35xGa08QgytOfvr1CK9aescI,60
5
- tsvz-3.28.dist-info/top_level.txt,sha256=OPx4LvOpaYykaos7oL_jGaObSWXxLzhHiWLuz-K147g,5
6
- tsvz-3.28.dist-info/RECORD,,
File without changes