csv-detective 0.7.5.dev1139__py3-none-any.whl → 0.7.5.dev1180__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.
@@ -19,7 +19,7 @@ liste_bool = set(bool_mapping.keys())
19
19
 
20
20
 
21
21
  def bool_casting(val: str) -> bool:
22
- return bool_mapping.get(val)
22
+ return bool_mapping.get(val.lower())
23
23
 
24
24
 
25
25
  def _is(val: str) -> bool:
@@ -81,16 +81,14 @@ def return_all_tests(
81
81
 
82
82
  if isinstance(user_input_tests, str):
83
83
  user_input_tests = [user_input_tests]
84
- if "ALL" in user_input_tests:
84
+ if "ALL" in user_input_tests or all(x[0] == "-" for x in user_input_tests):
85
85
  tests_to_do = [detect_type]
86
86
  else:
87
- # can't require to only skip tests
88
- assert not all(x[0] == "-" for x in user_input_tests)
89
87
  tests_to_do = [
90
- detect_type + "." + x for x in user_input_tests if x[0] != "-"
88
+ f"{detect_type}.{x}" for x in user_input_tests if x[0] != "-"
91
89
  ]
92
90
  tests_skipped = [
93
- detect_type + "." + x[1:] for x in user_input_tests if x[0] == "-"
91
+ f"{detect_type}.{x[1:]}" for x in user_input_tests if x[0] == "-"
94
92
  ]
95
93
  all_tests = [
96
94
  # this is why we need to import detect_fields/labels
@@ -257,17 +255,19 @@ def routine(
257
255
  )
258
256
 
259
257
  # To reduce false positives: ensure these formats are detected only if the label yields
260
- # a detection.
258
+ # a detection (skipping the ones that have been excluded by the users).
261
259
  formats_with_mandatory_label = [
262
- "code_departement",
263
- "code_commune_insee",
264
- "code_postal",
265
- "latitude_wgs",
266
- "longitude_wgs",
267
- "latitude_wgs_fr_metropole",
268
- "longitude_wgs_fr_metropole",
269
- "latitude_l93",
270
- "longitude_l93",
260
+ f for f in [
261
+ "code_departement",
262
+ "code_commune_insee",
263
+ "code_postal",
264
+ "latitude_wgs",
265
+ "longitude_wgs",
266
+ "latitude_wgs_fr_metropole",
267
+ "longitude_wgs_fr_metropole",
268
+ "latitude_l93",
269
+ "longitude_l93",
270
+ ] if f in scores_table.index
271
271
  ]
272
272
  scores_table.loc[formats_with_mandatory_label, :] = np.where(
273
273
  scores_table_labels.loc[formats_with_mandatory_label, :],
@@ -7,6 +7,8 @@
7
7
  - Better naming, hint types and minor refactors [#103](https://github.com/datagouv/csv-detective/pull/103)
8
8
  - The returned dataframe has its columns properly cast to the detected types [#104](https://github.com/datagouv/csv-detective/pull/104)
9
9
  - Raise an error if the encoding could not be guessed [#106](https://github.com/datagouv/csv-detective/pull/106)
10
+ - Allow to only specify tests to skip ("all but...") [#108](https://github.com/datagouv/csv-detective/pull/108)
11
+ - Fix bool casting [#109](https://github.com/datagouv/csv-detective/pull/109)
10
12
 
11
13
  ## 0.7.4 (2024-11-15)
12
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: csv_detective
3
- Version: 0.7.5.dev1139
3
+ Version: 0.7.5.dev1180
4
4
  Summary: Detect CSV column content
5
5
  Home-page: https://github.com/etalab/csv_detective
6
6
  Author: Etalab
@@ -2,7 +2,7 @@ csv_detective/__init__.py,sha256=Au4bNJ_Gi6P6o0uO4R56nYdshG7M6-7Rg_xX4whLmLI,143
2
2
  csv_detective/cli.py,sha256=Ua7SE1wMH2uFUsTmfumh4nJk7O06okpMd2gvjUDO1II,1048
3
3
  csv_detective/create_example.py,sha256=358e7Q7RWMrY_eEo3pUteJWmg2smFb5edJ_AzcQPrqA,8646
4
4
  csv_detective/detection.py,sha256=zrP8qvLDvhVXTHi7Ty8G_ga4zfZPjBhuyApqFQkPq2Y,22373
5
- csv_detective/explore_csv.py,sha256=-AxnM0hGlhrbI4w1wdZwC_w-DYgoOCFpMQ94agIaD5U,17380
5
+ csv_detective/explore_csv.py,sha256=BY1_X7OH2Lod08DTBwWaGvguc2OhpwOko4nlI8rf0HM,17470
6
6
  csv_detective/process_text.py,sha256=rsfk66BCmdpsCOd0kDJ8tmqMsEWd-OeBkEisWc4Ej9k,1246
7
7
  csv_detective/s3_utils.py,sha256=1cIVdQUYY2ovErbMwp72Gqtqx2bkB8nfVhn-QaOFTT0,1451
8
8
  csv_detective/schema_generation.py,sha256=D1Cq4QRajsKtY8EJSwbRTIB-T_Cb2ZpcmYtCrJ6DvJQ,13135
@@ -55,7 +55,7 @@ csv_detective/detect_fields/geo/latitude_wgs/__init__.py,sha256=ArS6PuYEd0atZwSq
55
55
  csv_detective/detect_fields/geo/latlon_wgs/__init__.py,sha256=3nlBqFYD4kVSVxw4b9DTPcxW59oL0T3Kj0OxPlyP9og,268
56
56
  csv_detective/detect_fields/geo/longitude_wgs/__init__.py,sha256=G7afWOKiGh_Tv7gwDNGt1a4B_A8hkCBkIxn3THDCUFk,330
57
57
  csv_detective/detect_fields/other/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- csv_detective/detect_fields/other/booleen/__init__.py,sha256=1qIEI681iEaPVb9XxmH2ewxDdfmYhHe4-s3MZ6L1A9Q,489
58
+ csv_detective/detect_fields/other/booleen/__init__.py,sha256=wn_yyTAmGxqo0l0b7JRpGb0da_E27iGxES9zWCrnsqc,497
59
59
  csv_detective/detect_fields/other/email/__init__.py,sha256=O9tgJmq0O8Q-8iin63NqEEDhlsUJjxFZNaNFM4GZaws,178
60
60
  csv_detective/detect_fields/other/float/__init__.py,sha256=dpEd5ZijmjQ7gqcTnYRoRoLGGJae0RyGwVC6MPra9go,549
61
61
  csv_detective/detect_fields/other/int/__init__.py,sha256=QN3kQJLYqLRBiubUK7g4Xq03PlA5wqVwx2pPPIO9FdI,320
@@ -127,18 +127,18 @@ csv_detective/detect_labels/temp/date/__init__.py,sha256=-R7VqlryozelSn4wH_7w9x6
127
127
  csv_detective/detect_labels/temp/datetime_iso/__init__.py,sha256=Ih9l56nBcdmGLyWDavVUWuUUuVZBz9QUDE1hHzADvVg,1157
128
128
  csv_detective/detect_labels/temp/datetime_rfc822/__init__.py,sha256=DQ_h4uDW1e6qu2rATEhgGKw6O-vVi7HbDhbEDDCT9uY,1175
129
129
  csv_detective/detect_labels/temp/year/__init__.py,sha256=zPF_mvhzhXMAlHPAskS8mhuxjLj2AlKpV4ss8Q4tDms,1150
130
- csv_detective-0.7.5.dev1139.data/data/share/csv_detective/CHANGELOG.md,sha256=jgcSpxGkuEdOQtQ08tRFflkCNuHstGFHN_29Tv6M1dE,7176
131
- csv_detective-0.7.5.dev1139.data/data/share/csv_detective/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
132
- csv_detective-0.7.5.dev1139.data/data/share/csv_detective/README.md,sha256=Qr8xRXc-dxQ-tdXCpCTCKp1Uliqq84r0UOlPRNuGCpI,9506
130
+ csv_detective-0.7.5.dev1180.data/data/share/csv_detective/CHANGELOG.md,sha256=j5OyYgmRMfYqQoEzY6In6OdivOZR3kpv9AlXkda5vpA,7366
131
+ csv_detective-0.7.5.dev1180.data/data/share/csv_detective/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
132
+ csv_detective-0.7.5.dev1180.data/data/share/csv_detective/README.md,sha256=Qr8xRXc-dxQ-tdXCpCTCKp1Uliqq84r0UOlPRNuGCpI,9506
133
133
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  tests/test_example.py,sha256=0NfChooJQlFxTo2nY5FOQIcsK4zzWA_SBmt2LwVQovY,2014
135
135
  tests/test_fields.py,sha256=_96htvTzvM7u-W57RpOBbsacWirIm4R36PP7JhPEaYQ,11123
136
136
  tests/test_file.py,sha256=HO-Zqv0ZDFy3d0ZrpjWQPXBrwgUmzesseoEofy8G2UU,7529
137
137
  tests/test_labels.py,sha256=6MOKrGznkwU5fjZ_3oiB6Scmb480Eu-9geBJs0UDLds,159
138
138
  tests/test_structure.py,sha256=SVsnluVoIIprYw_67I1_gB3cp9m1wlO8C7SpdsLW8cM,1161
139
- csv_detective-0.7.5.dev1139.dist-info/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
140
- csv_detective-0.7.5.dev1139.dist-info/METADATA,sha256=L-WEqkw3fze2JUmOVwfqV1Ttgsf5lhi_WqEULi0AKkA,1364
141
- csv_detective-0.7.5.dev1139.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
142
- csv_detective-0.7.5.dev1139.dist-info/entry_points.txt,sha256=JjweTReFqKJmuvkegzlew2j3D5pZzfxvbEGOtGVGmaY,56
143
- csv_detective-0.7.5.dev1139.dist-info/top_level.txt,sha256=M0Nv646VHo-49zWjPkwo2C48UmtfddV8_9mEZeIxy8Q,20
144
- csv_detective-0.7.5.dev1139.dist-info/RECORD,,
139
+ csv_detective-0.7.5.dev1180.dist-info/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
140
+ csv_detective-0.7.5.dev1180.dist-info/METADATA,sha256=MPk6yPPa_Xm0K9edLe_7DfXGCVniEP8cs1tHQqJGzvo,1364
141
+ csv_detective-0.7.5.dev1180.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
142
+ csv_detective-0.7.5.dev1180.dist-info/entry_points.txt,sha256=JjweTReFqKJmuvkegzlew2j3D5pZzfxvbEGOtGVGmaY,56
143
+ csv_detective-0.7.5.dev1180.dist-info/top_level.txt,sha256=M0Nv646VHo-49zWjPkwo2C48UmtfddV8_9mEZeIxy8Q,20
144
+ csv_detective-0.7.5.dev1180.dist-info/RECORD,,