Metadata-Version: 2.2
Name: dabih
Version: 1.0.1
Summary: A package to conveniently use the dabih API
Author-email: Charlotte Richter <hedwig-charlotte.richter@stud.uni-regensburg.de>
Project-URL: Homepage, https://github.com/charlotterchtr/dabih-python-package
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.3
Requires-Dist: requests>=2.31.0
Requires-Dist: httpx<0.28.0,>=0.20.0
Requires-Dist: attrs>=21.3.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: pyyaml>=0.1.0
Requires-Dist: cryptography>=44.0.0

### Dabih Python Package

A Command Line Interface tool to interact with the API of the Dabih Data Storage platform published by the Spang Lab (https://github.com/spang-lab/dabih).

The dabih python package allows you to upload, download, search and list files from the Dabih Data Storage platform, directly from the command line. 

#### Installation

**Install from PyPI:**

```bash
pip install dabih
```

**Or install in editable mode:**

After cloning this library, you can install the dabih python package via: 

```bash
pip install -e .
```

#### Set Up Guide

Create a folder named dabih at either ~/.config (create ~/.config if necessary) or at your default XDG_CONFIG_HOME location. In the dabih folder, create a config.yaml file with the following format:

```yaml
base_url: "http://localhost:3000"
token: "your token"
```

Save any dabih private keys (.pem files) in that dabih folder as well. The .pem files should have 'dabih' at some point in their file name or they won't be recognised as dabih private keys.

After completing the setup, run: 
```bash
dabih check
```
to test for URL, token and key-files being valid.

#### Example usage: 

To see all available commands and options:
```bash
dabih
```
Example for uploading or downloading a file:
```bash
dabih upload <filename> <target_folder_mnemonic>
dabih upload <filename>
dabih download <mnemonic>
```

For debugging, use -v:
```bash
dabih -v token-info
```
