datagouv / csv-detective

CSV inspection
45 stars 10 forks source link

json as python_type? #45

Closed abulte closed 1 year ago

abulte commented 1 year ago

While not a primary type (same as #43), it would be nice to know that a column contains some json.

Pierlou commented 1 year ago

How would you like it :

'structured_info': {'python_type': 'string', 'format': 'json', 'score': 1.0}

'structured_info': {'python_type': 'json', 'format': 'json', 'score': 1.0}

'structured_info': {'python_type': 'json', 'format': 'something_else?', 'score': 1.0}

abulte commented 1 year ago

'structured_info': {'python_type': 'json', 'format': 'something_else?', 'score': 1.0} because format could be geojson or even geojson_polygon.

As per #43, alternative solution: 'structured_info': {'python_type': 'str', 'python_extended_type': json, 'format': 'something_else?', 'score': 1.0}

Pierlou commented 1 year ago

Currently, geojson are handled as follow:

'geo_info': {'python_type': 'string', 'format': 'json_geojson', 'score': 1.0}

A solution could be:

abulte commented 1 year ago

Works for me!

abulte commented 1 year ago

Solved by #48