Metadata-Version: 2.1
Name: doipy
Version: 0.2.0
Summary: A Python wrapper for DOIP.
Author: Triet Doan
Author-email: triet.doan@gwdg.de
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 1 - Planning
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pydantic (>=2.6.3,<3.0.0)
Requires-Dist: pydantic-settings (>=2.2.1,<3.0.0)
Requires-Dist: rich (>=13.7.0,<14.0.0)
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
Description-Content-Type: text/markdown

# DOIPY

## Install

Simply run

```shell
$ pip install doipy
```

## Usage

This `doipy` package has two methods:

* `hello(name: str)`: say hello to the input name.
* `create(files: list[BinaryIO])`: loop through a list of files and do something.

To use it in the Command Line Interface, run:

```shell
$ doipy hello <username> <password>
# DOIP requires user authentication for 0.DOIP/Op.Hello

$ doipy create file1 file2 file3
# Output of the create command

$ doipy search <query string> --username <username> --password <password>
```

To use it in the Python code simply import it and call the exposed methods.

```python
from doipy import hello, create

hello(name='John')

with open('file1.txt', 'rb') as file1, open('file2.png', 'rb') as file2:
    create(files=[file1, file2])
```

## For developer

The project is managed by [Poetry](https://python-poetry.org/). Therefore, make sure that Poetry is installed in your
system. Then run

```shell
$ poetry install
```

to install all dependencies.

Then, install `doipy` package in editable mode. To do so, under the root directory, run:

```shell
$ pip install --editable .
```
## Create FDO 

1) create a digital object (DO) of the data bitstream
`doipy create <file> --md-file <md-file> --client-id <client-id> --password <password>`
note down the "id" of the created DO.
2) create a digital object (DO) of the metadata bitstream
`doipy create <metadata-file> --md-file <md-metadata-file> --client-id <client-id> --password <password>`
not down the "id" of the created DO.

3) Create FDO
`doipy create_fdo <id-data-DO> <id-metadata-DO>--client-id <client-id> --password <password>`

