...
- JSON format is flexible, ideally, the import API ought to parse user's JSON files without asking user to reformat the files according to a strict rule.
- User can store scalar fields and vector fields in a JSON file, with row-based or column-based, the . The import() API ought t can support both of them.
A Store scalar fields and vector field data in a JSON file with row-based example:
Code Block |
---|
{ "table": { "rows": [ {"id": 1, "year": 2021, "vector": [1.0, 1.1, 1.2]}, {"id": 2, "year": 2022, "vector": [2.0, 2.1, 2.2]}, {"id": 3, "year": 2023, "vector": [3.0, 3.1, 3.2]} ] } } |
A Store scalar fields and vector field data in a JSON file with column-based example:
Code Block |
---|
{ "table": { "columns": [ "id": [1, 2, 3], "year": [2021, 2022, 2023], "vector": [ [1.0, 1.1, 1.2], [2.0, 2.1, 2.2], [3.0, 3.1, 3.2] ] ] } } |
...
Based on the several points, we choose a JSON object as a parameter of python import() API, the API declaration will be like this:
def import(options)
The parameter "options" is a JSON object which has the following format:
...