Metadata-Version: 2.4
Name: remat-data
Version: 1.1.1
Summary: Download datasets from the RE-MAT Clowder
Project-URL: Homepage, https://github.com/re-mat/remat-data-downloader
Project-URL: Bug Tracker, https://github.com/re-mat/remat-data-downloader/issues
Project-URL: Discussions, https://github.com/re-mat/remat-data-downloader/discussions
Project-URL: Changelog, https://github.com/re-mat/remat-data-downloader/releases
Author-email: Ben Galewsky <bengal1@illinois.edu>
License: BSD 3-Clause License
        
        Copyright (c) 2024, Ben Galewsky.
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        * Neither the name of the vector package developers nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: chardet==3.0.4
Requires-Dist: pyclowder==2.7.0
Requires-Dist: rich==13.8.1
Requires-Dist: six==1.16.0
Requires-Dist: typer==0.12.5
Requires-Dist: urllib3==1.26.17
Provides-Extra: dev
Requires-Dist: pytest-cov>=3; extra == 'dev'
Requires-Dist: pytest>=6; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2023.08.17; extra == 'docs'
Requires-Dist: myst-parser>=0.13; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx>=7.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-cov>=3; extra == 'test'
Requires-Dist: pytest>=6; extra == 'test'
Description-Content-Type: text/markdown

# RE-MAT Data

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]

[![PyPI version][pypi-version]][pypi-link]
[![Conda-Forge][conda-badge]][conda-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

[![GitHub Discussion][github-discussions-badge]][github-discussions-link]

This package provides a simple interface to download and upload datasets used in
the ReMat project.

## Installation

This is a python package and can be installed using pip:

```bash
pip install remat-data-downloader
```

## Authentication

You need to obtain a Clowder API key to use this package. You can obtain this
key by logging into the
[RE-MAT Clowder instance](https://re-mat.clowder.ncsa.illinois.edu/) and going
to your user settings page (grey silhouette in the upper right corner of the
page). Click on the _API Keys_ tab and create a new key. Save this key in a file
nameed `clowder_key.txt` in the directory where you will be running the
`remat-download-data` command.

## Usage

The remat-data command can be run from your command line. It has commands to
interact with Clowder spaces and with datasets.

### List Spaces

```bash
remat-data spaces list

                      Clowder Spaces
┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Name              ┃ ID                       ┃ datasets ┃
┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Front velocities  │ 6674972be4b0a2d1b9ba0228 │ 303      │
│ DSC Post Cures    │ 6669d4d0e4b0a2d1b9b9a797 │ 228      │
│ DSC Cure Kinetics │ 64343b6be4b01a23c58bad90 │ 307      │
└───────────────────┴──────────────────────────┴──────────┘

```

### Download Datasets

Now that you know the unique ID for the space you want to download, you can
download the datasets using the `download` command. This command will create
subdirectories for each dataset and download the metadata as a json file and the
DSC Curve as a csv file.

You can re-run this command, and it will skip downloads of datasets that already
exist in the directory.

```bash
remat-data spaces download 6669d4d0e4b0a2d1b9b9a797
```

### Upload Files to Space

Using the `upload` command, you can upload files to a space. The command takes
the space name as a flag, optional --name flag for the dataset name and a list
of file name to upload. If dataset name is not mentioned, A default dataset is
created and the files are uploaded under the newly created dataset

Valid values of spaces are: --Cure, --PostCure, --FrontVelocity │

For help run

```
remat-data spaces upload --help
```

Command to upload:

```bash

 remat-data spaces upload --Cure --name TEST-dataset-2 test3.csv DSC_Curve.csv
```

### Configuration

Application configuration and space name to UUID mapping is stored in config.py
Add new spaces to this config.py file

<!-- SPHINX-START -->

<!-- prettier-ignore-start -->
[actions-badge]:            https://github.com/re-mat/remat-data-downloader/workflows/CI/badge.svg
[actions-link]:             https://github.com/re-mat/remat-data-downloader/actions
[conda-badge]:              https://img.shields.io/conda/vn/conda-forge/remat-data-downloader
[conda-link]:               https://github.com/conda-forge/remat-data-downloader-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]:  https://github.com/re-mat/remat-data-downloader/discussions
[pypi-link]:                https://pypi.org/project/remat-data-downloader/
[pypi-platforms]:           https://img.shields.io/pypi/pyversions/remat-data-downloader
[pypi-version]:             https://img.shields.io/pypi/v/remat-data-downloader
[rtd-badge]:                https://readthedocs.org/projects/remat-data-downloader/badge/?version=latest
[rtd-link]:                 https://remat-data-downloader.readthedocs.io/en/latest/?badge=latest

<!-- prettier-ignore-end -->
