diff --git a/README.md b/README.md index 50188d8693..83153bc08b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ebrains_storage -============== +=============== Python client interface for EBRAINS Collaboratory Drive (Seafile) and Bucket (Data-Proxy) storage. @@ -9,11 +9,12 @@ https://github.com/haiwen/python-seafile by Shuai Lin (linshuai2012@gmail.com) -Updated for integration with HBP v2 Collaboratory's Seafile storage +Updated for integration with HBP v2 Collaboratory's Seafile storage (now EBRAINS Drive) by Shailesh Appukuttan (appukuttan.shailesh@gmail.com) +Updated with support for EBRAINS Bucket storage by Xiao Gui. -Documentation: https://github.com/HumanBrainProject/ebrains-drive/blob/master/doc.md +Documentation: https://github.com/HumanBrainProject/ebrains-storage/blob/master/doc.md Installation: `pip install ebrains_drive` @@ -31,7 +32,7 @@ Example usage (refer to docs for more): from ebrains_drive.client import DriveApiClient client = DriveApiClient(username="hbp_username", password="password") - + # 3. Working with Collab drives (libraries / repos) # 3.1 Get list of all libraries that user has access to list_repos = client.repos.list_repos() @@ -40,7 +41,7 @@ Example usage (refer to docs for more): print(repo_obj.__dict__) # 4. Working with directories - # 4.1 Get info of a directory + # 4.1 Get info of a directory repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355') dir_obj = repo_obj.get_dir('/') # specify dir path; '/' signifies root directory print(dir_obj.__dict__) @@ -49,7 +50,7 @@ Example usage (refer to docs for more): # 5. Working with files - # 5.1 Get info of a file + # 5.1 Get info of a file repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355') file_obj = repo_obj.get_file('/sample-latest.csv') # specify file path print(file_obj.__dict__) @@ -108,11 +109,11 @@ Read access of public buckets can be done without supplying a token: ```python from ebrains_drive import BucketApiClient - + # anonymous client only has read access to public buckets anon_client = BucketApiClient() public_bucket = anon_client.buckets.get_bucket("reference-atlas-data") - + # list all files under static/ files = public_bucket.ls(prefix="static") print([f.name for f in files]) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..c2a5c0554f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "ebrains-drive" +description = "Python client interface for EBRAINS Collaboratory Drive and Bucket storage" +readme = "README.md" +requires-python = ">=3.9" +license = {text = "Apache-2.0"} +authors = [ + {name = "EBRAINS", email = "support@ebrains.eu"} +] +maintainers = [ + {name = "EBRAINS", email = "support@ebrains.eu"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering" +] +dependencies = [ + "requests", + "tqdm" +] +dynamic = ["version"] + +[project.optional-dependencies] +test = [ + "pytest", + "wheel" +] + +[project.urls] +documentation = "https://github.com/HumanBrainProject/ebrains-storage/blob/master/doc.md" +repository = "https://github.com/HumanBrainProject/ebrains-storage" +download = "https://pypi.org/project/ebrains-drive/" + +[build-system] +requires = ["setuptools", "setuptools_scm[toml]"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "ebrains_drive/_version.py" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 2a40fc4d4f..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -requests -tqdm -version-query==1.1.0 diff --git a/setup.py b/setup.py index 22de2063ff..606849326a 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,3 @@ -from setuptools import setup, find_packages -from version_query import predict_version_str +from setuptools import setup -__version__ = predict_version_str() - - -setup(name='ebrains-drive', - version=__version__, - license='Apache-2.0 License', - description='Python client interface for EBRAINS Collaboratory Seafile storage', - author='EBRAINS, CNRS', - author_email='support@ebrains.eu', - url='https://github.com/HumanBrainProject/ebrains-drive/', - platforms=['Any'], - packages=find_packages(), - install_requires=['requests', 'tqdm'], - classifiers=['Development Status :: 4 - Beta', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python'], - ) +setup()