This project is part of Datasets toolkit.
Running server (https://github.com/tivvit/datasets_server) is needed for this project to be useful.
pip install datasetstools
datasets
command is provided after the installation
It is recommended to configure the server address first. You may always
provide it with -s
.
datasets config
Server address (example.com): localhost
Port: 8000
The configuration will be saved to ~/.datasets
and will be used also by the
python library.
Generate new UID for the data set and creates file dataset.yaml
with
prefilled structure.
Rescan the data sets.
info
shows all the information about the data set. The data set is
recognized based on dataset.yaml
which is searched bottom-up.
usages
shows only usages and changelog
only the changelog respectively
Python library for interacting with the Datasets.
from datasets import Datasets
ds = Datasets()
# Without args the address in ~/.datasets will be used or {"addres": "http:localhost:5000"} may be used
Returns information about the data set identified by the UID. Second param - usage
ds.info("8b88a424-dbd8-4032-8be7-a930a415b9a5", {"user": "tivvit"})
Returns list of paths where the data set may be found. Second param - usage
ds.paths("8b88a424-dbd8-4032-8be7-a930a415b9a5", {"user": "tivvit"})
# ["/data/a", "/data/b"]
Creates data set in the database. Useful for pragmatical data set creation.
data
- dict with the data set attributespath
- path where should thedataset.yaml
should be created (optional).
Returns data set UID.
ds.create(data={"name": "Best DS", ...}, path="")
# "8b88a424-dbd8-4032-8be7-a930a415b9a5"
Actions are logged to the usage log, the second parameter is optional and will be stored in the usage log.
Feel free to contribute.
© 2016 Vít Listík
Released under MIT license