c-3lab / dim-python

MIT License
0 stars 0 forks source link

Add load feature #13

Open ryo-ma opened 2 years ago

ryo-ma commented 2 years ago

Summary

example

import dim
dim.load(name="example-json", file_type="json")
# return example.json data as dict type

method

Solutions

No response

APIs to be deprecated

No response

Additional Context

No response

lisphilar commented 2 years ago

Is this funciton for the following commands of dim-deno?

If so, we may implement dim.load(filepath_or_buffer: Union[str, bytes, os.PathLike] = "example-json.json"). filepath_or_buffer is a positional argument. (Please try to avoid type argument because this will over-write build-in type of Python.)

ryo-ma commented 2 years ago
$ dim install -f ./path/dim.json
$ dim install -f https://raw.githubusercontent.com/xxxx/xxxx/main/dim.json

These two correspond to install_from_file.

https://github.com/c-3lab/dim-python/issues/8

ryo-ma commented 2 years ago

This function can load the file by specifying the name described in dim.json

lisphilar commented 2 years ago

Sorry for my incorrect understanding.

Just to confirm, "name" is the dataset name (title) and this function returns each dataset as follows.

Is not possible to save file_type information in dim.json or dim-lock.json? This may require changes of dim-deno commands.

ryo-ma commented 2 years ago

How does the user specify the file_type when saving file_type with dim.json?