csv-detective 0.10.1.dev2599__py3-none-any.whl → 0.10.1.dev2616__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.
@@ -1,4 +1,5 @@
1
1
  from csv_detective.formats.float import _is as is_float
2
+ from csv_detective.formats.int import _is as is_int
2
3
 
3
4
  proportion = 1
4
5
  tags = ["geo"]
@@ -26,12 +27,18 @@ labels = SHARED_LATITUDE_LABELS | {
26
27
 
27
28
  def _is(val):
28
29
  try:
29
- return is_float(val) and float(val) >= -90 and float(val) <= 90
30
+ return (
31
+ is_float(val)
32
+ and -90 <= float(val) <= 90
33
+ # we ideally would like a certain level of decimal precision
34
+ # but 1.200 is saved as 1.2 in csv so we just discriminate ints
35
+ and not is_int(val)
36
+ )
30
37
  except Exception:
31
38
  return False
32
39
 
33
40
 
34
41
  _test_values = {
35
- True: ["43.2", "-22"],
36
- False: ["100"],
42
+ True: ["43.2872", "-22.61", "-3.0"],
43
+ False: ["100.1973", "40"],
37
44
  }
@@ -1,5 +1,4 @@
1
- from csv_detective.formats.float import _is as is_float
2
- from csv_detective.formats.latitude_wgs import labels # noqa
1
+ from csv_detective.formats.latitude_wgs import _is as is_latitude, labels # noqa
3
2
 
4
3
  proportion = 1
5
4
  tags = ["fr", "geo"]
@@ -9,12 +8,12 @@ python_type = "float"
9
8
 
10
9
  def _is(val):
11
10
  try:
12
- return is_float(val) and float(val) >= 41.3 and float(val) <= 51.3
11
+ return is_latitude(val) and 41.3 <= float(val) <= 51.3
13
12
  except Exception:
14
13
  return False
15
14
 
16
15
 
17
16
  _test_values = {
18
- True: ["42.5"],
19
- False: ["22.5", "62.5"],
17
+ True: ["42.576", "42.5"],
18
+ False: ["22.5"],
20
19
  }
@@ -49,6 +49,6 @@ def _is(val):
49
49
 
50
50
 
51
51
  _test_values = {
52
- True: ["43.2,-22.6", "-10.7,140", "-40.7, 10.8", "[12,-0.28]"],
53
- False: ["0.1,192", "-102, 92", "[23.02,4.1", "23.02,4.1]", "160.1,-27"],
52
+ True: ["43.2,-22.6", "-10.71,140.0", "-40.791, 10.81", "[12.01,-0.28]"],
53
+ False: ["0.1,192", "-102, 92", "[23.02,4.1", "23.02,4.1]", "160.1,-27", "1,2", "43, -23"],
54
54
  }
@@ -1,4 +1,5 @@
1
1
  from csv_detective.formats.float import _is as is_float
2
+ from csv_detective.formats.int import _is as is_int
2
3
 
3
4
  proportion = 1
4
5
  tags = ["geo"]
@@ -29,12 +30,18 @@ labels = SHARED_LONGITUDE_LABELS | {
29
30
 
30
31
  def _is(val):
31
32
  try:
32
- return is_float(val) and float(val) >= -180 and float(val) <= 180
33
+ return (
34
+ is_float(val)
35
+ and -180 <= float(val) <= 180
36
+ # we ideally would like a certain level of decimal precision
37
+ # but 1.200 is saved as 1.2 in csv so we just discriminate ints
38
+ and not is_int(val)
39
+ )
33
40
  except Exception:
34
41
  return False
35
42
 
36
43
 
37
44
  _test_values = {
38
- True: ["120", "-20.2"],
39
- False: ["-200"],
45
+ True: ["120.8263", "-20.27", "31.0"],
46
+ False: ["-200", "20"],
40
47
  }
@@ -1,5 +1,4 @@
1
- from csv_detective.formats.float import _is as is_float
2
- from csv_detective.formats.longitude_wgs import labels # noqa
1
+ from csv_detective.formats.longitude_wgs import _is as is_longitude, labels # noqa
3
2
 
4
3
  proportion = 1
5
4
  tags = ["fr", "geo"]
@@ -9,12 +8,12 @@ python_type = "float"
9
8
 
10
9
  def _is(val):
11
10
  try:
12
- return is_float(val) and float(val) >= -5.5 and float(val) <= 9.8
11
+ return is_longitude(val) and -5.5 <= float(val) <= 9.8
13
12
  except Exception:
14
13
  return False
15
14
 
16
15
 
17
16
  _test_values = {
18
- True: ["-2.5"],
17
+ True: ["-2.01", "8.0"],
19
18
  False: ["12.8"],
20
19
  }
@@ -32,6 +32,6 @@ def _is(val):
32
32
 
33
33
 
34
34
  _test_values = {
35
- True: ["-22.6,43.2", "140,-10.7", "10.8, -40.7", "[-0.28,12]"],
36
- False: ["192,0.1", "92, -102", "[4.1,23.02", "4.1,23.02]", "-27,160.1"],
35
+ True: ["-22.6,43.012", "140.0,-10.70", "10.829, -40.71", "[-0.28,12.43]"],
36
+ False: ["192,0.1", "92, -102", "[4.1,23.02", "4.1,23.02]", "-27,160.1", "2,4", "-22, 43.0"],
37
37
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: csv-detective
3
- Version: 0.10.1.dev2599
3
+ Version: 0.10.1.dev2616
4
4
  Summary: Detect tabular files column content
5
5
  Keywords: CSV,data processing,encoding,guess,parser,tabular
6
6
  Author: data.gouv.fr
@@ -49,13 +49,13 @@ csv_detective/formats/iso_country_code_numeric.py,sha256=bpBUb5IQTU-s_-E81iq9dA6
49
49
  csv_detective/formats/jour_de_la_semaine.py,sha256=5ScA-UU1EGP_WgycP3NpGVxTeKOyAZlNFOA2mtOuCdc,603
50
50
  csv_detective/formats/json.py,sha256=5mCr50RvKFsbMQ-Ad1ORZ6UvOS9v3GUCh6z37mNT57I,534
51
51
  csv_detective/formats/latitude_l93.py,sha256=PIXHXaOuVdlcYJKPvUJ5hcEF52U9an6Je5vQ-hyN4rs,813
52
- csv_detective/formats/latitude_wgs.py,sha256=GPjs48G3nkuisrnBCydnzgerowothC5TMQgCieuSAWI,689
53
- csv_detective/formats/latitude_wgs_fr_metropole.py,sha256=BW5WYyYqHpjmG3Z72q1Xi_DIwEOp_vedFeplaaC985Q,433
54
- csv_detective/formats/latlon_wgs.py,sha256=Nipo6Yvqc-SVEEeTLANGh1xDpzLvO-LcDbttKdL8ddE,1319
52
+ csv_detective/formats/latitude_wgs.py,sha256=PNuoUJMxPsfpHhn3wN6q4HyTqNyFjfbfhfkQGyx9L4g,975
53
+ csv_detective/formats/latitude_wgs_fr_metropole.py,sha256=IOGF6j6I_eZS35rwRmZDt9XRrnJctlt_eUGsNVXIGlw,386
54
+ csv_detective/formats/latlon_wgs.py,sha256=gEnswtAGKIemFaIUb6X1jPrh8UBPvPZkOT7-jUhETfc,1346
55
55
  csv_detective/formats/longitude_l93.py,sha256=BnY8rx0ITlMI2x68yF_GjwwS72S-X_ZXD5V3W0Mgzg4,803
56
- csv_detective/formats/longitude_wgs.py,sha256=tgXSgim-SEvS4-snjUEehD3IHU92jrQ-DXdLPQZhvcE,750
57
- csv_detective/formats/longitude_wgs_fr_metropole.py,sha256=XBnWyjWslkrWuDH6gf8qIPEM_gzesTNBCzxbOmX9q3M,425
58
- csv_detective/formats/lonlat_wgs.py,sha256=Nd2e_OiI0Mtzs0ixxHqpsgMZtoivvWSywFWUUwZq6So,1051
56
+ csv_detective/formats/longitude_wgs.py,sha256=3I5cflrVcfEH3SHd7BMK284t_-Y5C1AyOS480zDcfTI,1031
57
+ csv_detective/formats/longitude_wgs_fr_metropole.py,sha256=vhL_UBdqvEgrNdZ65A0jyga24OtthU-B4WUGEg9evpc,386
58
+ csv_detective/formats/lonlat_wgs.py,sha256=_LEbZoi-f79ez-CKvzY-HoXL8t648URcXC4DRdtjbEU,1082
59
59
  csv_detective/formats/mois_de_lannee.py,sha256=BpzzAClRX-dbLwic42t4LAzceTtZFE236oPZT53EODs,765
60
60
  csv_detective/formats/money.py,sha256=kv09gQjpsplDdPy5IZBrdtQDv1FB96Jpk22JGj5JEf4,432
61
61
  csv_detective/formats/mongo_object_id.py,sha256=7UmSIHlYsaSpmv3rcyn-0eKdZr2qu2SssaihfWqBCYI,302
@@ -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.dev2599.dist-info/WHEEL,sha256=xDCZ-UyfvkGuEHPeI7BcJzYKIZzdqN8A8o1M5Om8IyA,79
90
- csv_detective-0.10.1.dev2599.dist-info/entry_points.txt,sha256=1J86TQNCanjsLMboAufdEUla03qEQaC9QmVGYgt2FCQ,57
91
- csv_detective-0.10.1.dev2599.dist-info/METADATA,sha256=uk8fyx-FqFG2Ez2Yx4_aKydaGNrqd_SfuDsYYLlyfKY,11064
92
- csv_detective-0.10.1.dev2599.dist-info/RECORD,,
89
+ csv_detective-0.10.1.dev2616.dist-info/WHEEL,sha256=xDCZ-UyfvkGuEHPeI7BcJzYKIZzdqN8A8o1M5Om8IyA,79
90
+ csv_detective-0.10.1.dev2616.dist-info/entry_points.txt,sha256=1J86TQNCanjsLMboAufdEUla03qEQaC9QmVGYgt2FCQ,57
91
+ csv_detective-0.10.1.dev2616.dist-info/METADATA,sha256=iib4MHLNBeDYLj_7hWV32zRaYz-lxiAf0icNu_Gmb4c,11064
92
+ csv_detective-0.10.1.dev2616.dist-info/RECORD,,