Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 811 Bytes

README.md

File metadata and controls

44 lines (27 loc) · 811 Bytes

EBRAINS util

Installation

pip install git+https://github.com/xgui3783/ebrains-util.git

Usage

import os
from ebrains_util import iam, kg, dataproxy
from pathlib import Path

token = iam.start_device_flow(scope=["team"])
os.environ["AUTH_TOKEN"] = token

path_to_my_dir = Path("my-dir")
path_to_my_file = Path("my-dir2/test.txt")

dataproxy.dataproxy_sync("my-bucket", path_to_my_dir)
dataproxy.dataproxy_sync("my-bucket", path_to_my_file)

or from command line:

echo "hello world" > foo.bar

# team is needed for dataproxy!
ebrains_util iam auth login --scope team
ebrains_util bucket -n MY_BUCKET_NAME upload foo.bar dest/foo.bar

If you would like the auth token to be stored/used from a different path, set EBRAINS_UTIL_USER_PATH env var.

License

MIT