Metadata-Version: 2.4
Name: dar_invenio_cli
Version: 0.1.0
Summary: Dar Invenio Command Line Interface
Home-page: https://gitlab.ics.muni.cz/dataraptors/elter/dar-invenio-cli
Author: Dominik Dubovsky <485020@mail.muni.cz>
License: MIT
Project-URL: Source, https://gitlab.ics.muni.cz/dataraptors/elter/dar-invenio-cli
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: requests
Requires-Dist: asyncio
Requires-Dist: aiohttp
Requires-Dist: click
Dynamic: license-file

# DAR-INVENIO-CLI

DAR-INVENIO-CLI is a command-line tool for creating drafts and uploading files in the Invenio webpage.

## Installation

You can install the package using pip:

```bash
pip install .
```

## Configuration

Before using the tool, you need to set up the configuration. The configuration with `api_token` is required.

```bash
dar-invenio-cli config init --api-token <your-api-token>
```

You can also update the values for `base-api-url` and `model` or `api_token` later:

```bash
dar-invenio-cli config update 
```
with optional options:
- `--base-api-url <your-base-api-url>`
- `--model <your-model>`
- `--api-token <your-api-token>`

You can see the current configuration by running:
```bash
dar-invenio-cli config show
```

## Usage

### Create a single draft

From a JSON file:
```bash
dar-invenio-cli create draft --from-file /path/to/your/file.json
```

From a name:
```bash
dar-invenio-cli create draft --from-name "My Draft Name"
```

### Create multiple drafts

From multiple JSON files:
```bash
dar-invenio-cli create drafts --from-files /path/to/file1.json /path/to/file2.json
```

From a folder containing JSON files:
```bash
dar-invenio-cli create drafts --from-folder /path/to/your/folder
```

### Upload files to a draft

```bash
dar-invenio-cli upload <draft_id> /path/to/file1 /path/to/file2
```

## For Developers

The core logic is located in `dar_invenio_cli/core.py`. You can import and use the functions from this module in your own Python projects.

## Deployment to PyPI

To deploy the package to PyPI, follow these steps:

1.  **Build the package:**

    ```bash
    python -m build
    ```

2.  **Install twine:**

    ```bash
    pip install twine
    ```

3.  **Upload to PyPI:**

    ```bash
    twine upload dist/*
    ```
