Users Guide
Creating a store
You can create your own store to catalog your data by using
import kosh
kosh_example_sql_file = "kosh_example.sql"
kosh.connect(kosh_example_sql_file, delete_all_contents=True)
Opening an existing store
Once you have a store you can connect to it
import kosh
kosh_example_sql_file = "kosh_example.sql"
# connect to store
store = connect(kosh_example_sql_file)
Adding datasets to the store
Adding attributes to the store
Associating data to a dataset
You can associate data to a dataset, you will need a "URI" to locate the associated data (this can be a file path or inernet address or database name, etc...) and a mimetype describing the data type. Mime-type are used to load the data
Reading data
Once data and mimetype have been associated to a dataset you can load these data in your application
Loaders
If multiple loaders are available you can specify the loader you want to use
# Image loader
my_loader = kosh.loader.pil.PILLoader # no need to instantiate
data = ds.get(features[0], loader=my_loader)
Transformers
Once data is loaded from its source URI you further process it (subsampling, format change, augmentation, etc...) via transformers.
Transformers offer the possibility to cache their result for faster computation the next time around. The default cache directory in stored in kosh.core.kosh_cache_dir
and points to: os.path.join(os.environ["HOME"], ".cache", "kosh")
.