Skip to main content

A high-level API for interacting with the Human Brain Project archival storage at CSCS

Project description

A high-level API for interacting with the Human Brain Project archival storage at CSCS.

Authors: Andrew Davison and Shailesh Appukuttan, CNRS

Documentation: https://hbp-archive.readthedocs.io

Installation: pip install hbp_archive

Usage:

    from hbp_archive import Container, PublicContainer, Project, Archive

    # Working with a public container

    container = PublicContainer("https://object.cscs.ch/v1/AUTH_id/my_container")
    files = container.list()
    local_file = container.download("README.txt")
    print(container.read("README.txt"))
    number_of_files = container.count()
    size_in_MB = container.size("MB")

    # Working with a private container

    container = Container("MyContainer", username="xyzabc")  # you will be prompted for your password
    files = container.list()
    local_file = container.download("README.txt", overwrite=True)  # default is not to overwrite existing files
    print(container.read("README.txt"))
    number_of_files = container.count()
    size_in_MB = container.size("MB")

    container.move("my_file.dat", "a_subdirectory", "new_name.dat")  # move/rename file within a container

    # Reading a file directly, without downloading it

    with container.open("my_data.txt") as fp:
        data = np.loadtxt(fp)

    # Working with a project

    my_proj = Project('MyProject', username="xyzabc")
    container = my_proj.get_container("MyContainer")

    # Listing all your projects

    archive = Archive(username="xyzabc")
    projects = archive.projects
    container = archive.find_container("MyContainer")  # will search through all projects
EU Logo

ACKNOWLEDGEMENTS

This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270 and No. 785907 (Human Brain Project SGA1 and SGA2).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hbp_archive-0.9.1.tar.gz (102.2 kB view details)

Uploaded Source

File details

Details for the file hbp_archive-0.9.1.tar.gz.

File metadata

  • Download URL: hbp_archive-0.9.1.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for hbp_archive-0.9.1.tar.gz
Algorithm Hash digest
SHA256 34248783d976955fb22bd7343e5fc1bb7adc716003df06da11620504929b57cf
MD5 716b4023de5126d475dee51de549314c
BLAKE2b-256 f5677ff37e4f22ae8cc7a8ce3b3f50768c67454332fb314b13e7b3bf131f312e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page