dataset.sh server
Using Docker
dataset.sh server is available as a docker container datasetsh/server, by default it use the following
configuration:
- data storage folder:
/dataset-sh-storage/data - server config path:
/dataset-sh-storage/dataset-sh-server-config.json
You can mount a local folder as a persistent storage for this container.
create an empty config file
docker run -v $(pwd):/dataset-sh-storage datasetsh/server dataset-sh-server-cli init
# -v $(pwd):/dataset-sh-storage -> mount current folder as storage folder
import
docker run -v $(pwd):/dataset-sh-storage -v /path/to/dataset/file:/tmp/upload.dataset datasetsh/server dataset.sh import username/dataset-name -f /tmp/upload.dataset
# -v $(pwd):/dataset-sh-storage -> mount current folder as storage folder
# -v /path/to/dataset/file:/tmp/upload.dataset -> mount the file to import
# dataset.sh import username/dataset-name -f /tmp/upload.dataset
Start server
docker run -p 8989:8989 \ # map container:8989 to host:8989 -v $(pwd):/dataset-sh-storage datasetsh/server
Without Docker
You can also use it without docker.
pip install dataset_sh_server
Create an empty config file
dataset-sh-server-cli init
Start server
gunicorn -b 127.0.0.1:8989 "dataset_sh_server.app:create_app()"
# bind to 0.0.0.0 for external access
dataset.sh -b ./ import username/dataset_name -f /path/to/dataset/file
Management scripts
If you are using docker, you can use the following management script for you own convenience.
#!/bin/bash
set -e
must_exist() {
local var_name="$1"
local var_value="$2"
if [ -z "$var_value" ]; then
echo "Error: '$var_name' is not defined or empty"
exit 1
fi
return
}
print_and_execute() {
local cmd="$@"
echo Executing CMD:
echo $'\t' $cmd
$cmd
}
start_server () {
local port=${1:-8989}
local storage_base_path=${2:-$(pwd)}
must_exist storage_base_path $storage_base_path
must_exist port $port
local cmd="docker run -p ${port}:8989 -v ${storage_base_path}:/dataset-sh-storage datasetsh/server"
print_and_execute $cmd
}
init_config () {
local storage_base_path=${1:-$(pwd)}
must_exist storage_base_path $storage_base_path
local cmd="docker run -v ${storage_base_path}:/dataset-sh-storage datasetsh/server python -m dataset_sh_server.cli init"
print_and_execute $cmd
}
set_password () {
local username=${1}
local storage_base_path=${2:-$(pwd)}
must_exist storage_base_path $storage_base_path
must_exist username $username
local cmd="docker run -it -v ${storage_base_path}:/dataset-sh-storage datasetsh/server python -m dataset_sh_server.cli set-password ${username}"
print_and_execute $cmd
}
import_dataset () {
local dataset_name=$1
local dataset_path=$2
local storage_base_path=${3:-$(pwd)}
must_exist dataset_name $dataset_name
must_exist dataset_path $dataset_path
must_exist storage_base_path $storage_base_path
local cmd="docker run -v ${storage_base_path}:/dataset-sh-storage -v ${dataset_path}:/tmp/upload.dataset datasetsh/server dataset.sh import ${dataset_name} -f /tmp/upload.dataset"
print_and_execute $cmd
}
"$@"
Metadata
Release files for dataset-sh-server 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dataset_sh_server-0.0.5.tar.gz | 2.0 MB | Without provenance | Details for dataset_sh_server-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dataset_sh_server-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for dataset_sh_server-0.0.5-py3-none-any.whl |
Total release size: 4.0 MB
Release files / dataset_sh_server-0.0.5.tar.gz
| Download URL | dataset_sh_server-0.0.5.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
132768ef48d419ca5a72b8bbe225e7d81f81fbfe62ded8818a347763e3bcd8e9
|
|
BLAKE2b-256 checksum How to use checksums |
851aec9559d7a83cccd8ea7e3266aa885d4a563eb6908da26181461547eab9a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / dataset_sh_server-0.0.5-py3-none-any.whl
| Download URL | dataset_sh_server-0.0.5-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
902a4795d3f25e6258f35248fbdc7e7456cfe278a15ca132cf8788f444c9ca31
|
|
BLAKE2b-256 checksum How to use checksums |
f531e03b190d6077ad62421d7cfca8752048cd7df37f8cbe7668c5966baaefe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for dataset-sh-server 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.