csv-detective 0.10.1.dev2651__py3-none-any.whl → 0.10.1.dev2669__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.
@@ -13,11 +13,16 @@ from csv_detective.parsing.csv import CHUNK_SIZE
13
13
  from csv_detective.utils import display_logs_depending_process_time
14
14
 
15
15
 
16
- def cast(value: str, _type: str) -> str | float | bool | date | datetime | bytes | None:
16
+ def cast(value: str, _type: str) -> str | int | float | bool | date | datetime | bytes | None:
17
17
  if not isinstance(value, str) or not value:
18
18
  # None is the current default value in hydra, should we keep this?
19
19
  return None
20
20
  match _type:
21
+ case "string":
22
+ # not used here, convenience for external use (cc hydra)
23
+ return value
24
+ case "int":
25
+ return int(value)
21
26
  case "float":
22
27
  return float_casting(value)
23
28
  case "bool":
@@ -81,7 +81,11 @@ def create_profile(
81
81
  del cast_col
82
82
  # for all formats we want most frequent values, nb unique values and nb missing values
83
83
  tops_bruts = (
84
- (table[c].value_counts() if _col_values is None else _col_values[c].sort_values())
84
+ (
85
+ table[c].value_counts()
86
+ if _col_values is None
87
+ else (s := _col_values[c]).loc[s.index.notna()].sort_values(ascending=False)
88
+ )
85
89
  .reset_index(name=_count_col)
86
90
  .iloc[:10]
87
91
  .to_dict(orient="records")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: csv-detective
3
- Version: 0.10.1.dev2651
3
+ Version: 0.10.1.dev2669
4
4
  Summary: Detect tabular files column content
5
5
  Keywords: CSV,data processing,encoding,guess,parser,tabular
6
6
  Author: data.gouv.fr
@@ -72,9 +72,9 @@ csv_detective/formats/username.py,sha256=6qviaFOtF2wg-gtvs0N8548JxFNE67Ue3a0JD0K
72
72
  csv_detective/formats/uuid.py,sha256=LxkRZFAOlfig5KKrravO9bgyYjmRBegzOtGyzjopVNc,352
73
73
  csv_detective/formats/year.py,sha256=tMc2HHr6Jga3PGWjmeHweK3G17DsjkIpIUUkCecXAm4,362
74
74
  csv_detective/output/__init__.py,sha256=ALSq_tgX7rGyh--7rmbKz8wHkmResN0h7mNujndow3w,2103
75
- csv_detective/output/dataframe.py,sha256=Hnd-AY51U0JMACcpuaK9wwO4oCX9Nd7ZLUTqavgJWRA,3406
75
+ csv_detective/output/dataframe.py,sha256=QX5vplx0AOKgnwwJ6dKvDHWRX9IGPStax-svXEyweJ8,3584
76
76
  csv_detective/output/example.py,sha256=8LWheSBYCeDFfarbnmzBrdCbTd8Alh1U4pfXMKfabOw,8630
77
- csv_detective/output/profile.py,sha256=VUQp0VJ22dfY4R5TybTpuQW_TOX_rLEp98cOzu-Jf44,4876
77
+ csv_detective/output/profile.py,sha256=ADr5DwuvwcBYxugjN38fHm11l6ivfzGHXPd8a87Ht-s,4985
78
78
  csv_detective/output/schema.py,sha256=XoKljXPXP00DfqPCiz1ydwTHYGAFsvNxnaPCNBuuBIo,10443
79
79
  csv_detective/output/utils.py,sha256=tbji3dEH7bDc6gLCeVSVquqU3xaHA1CQOMuaJT4Hub8,3297
80
80
  csv_detective/parsing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -86,7 +86,7 @@ csv_detective/parsing/load.py,sha256=f-8aKiNpy_47qg4Lq-UZUR4NNrbJ_-KEGvcUQZ8cmb0
86
86
  csv_detective/parsing/text.py,sha256=yDAcop5xJQc25UtbZcV0guHXAZQfm-H8WuJORTy8Rr8,1734
87
87
  csv_detective/utils.py,sha256=RJ_zFOJ1DRY8HtDrKPiCdNk5gU6-KwOrOKOyfSkBZZY,1118
88
88
  csv_detective/validate.py,sha256=CjZXhhDP-n6wGgEqbwrGRqebU8L5bidwnvQp-TbnvFA,5424
89
- csv_detective-0.10.1.dev2651.dist-info/WHEEL,sha256=xDCZ-UyfvkGuEHPeI7BcJzYKIZzdqN8A8o1M5Om8IyA,79
90
- csv_detective-0.10.1.dev2651.dist-info/entry_points.txt,sha256=1J86TQNCanjsLMboAufdEUla03qEQaC9QmVGYgt2FCQ,57
91
- csv_detective-0.10.1.dev2651.dist-info/METADATA,sha256=lb40dhW9vB62v0DlOMXafu6sUv7mWTM8Hi8BN1e9JSw,11064
92
- csv_detective-0.10.1.dev2651.dist-info/RECORD,,
89
+ csv_detective-0.10.1.dev2669.dist-info/WHEEL,sha256=XjEbIc5-wIORjWaafhI6vBtlxDBp7S9KiujWF1EM7Ak,79
90
+ csv_detective-0.10.1.dev2669.dist-info/entry_points.txt,sha256=1J86TQNCanjsLMboAufdEUla03qEQaC9QmVGYgt2FCQ,57
91
+ csv_detective-0.10.1.dev2669.dist-info/METADATA,sha256=MqiSxo1B23LDTq6iK68Ok1HzyiDknmIM2OgdyI6zo4Y,11064
92
+ csv_detective-0.10.1.dev2669.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.17
2
+ Generator: uv 0.9.25
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any