Skip to main content

A Python wrapper for DOIP.

Project description

DOIPY

Install

Simply run

$ 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:

$ 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.

from doipy import hello, create

hello(username='', password='')

do_type = 'Document'
with open('file1.txt', 'rb') as file1, open('file2.png', 'rb') as file2, open('metadata.json', 'r') as md_file:
    create(do_type=do_type, files=[file1, file2], md_file=md_file, client_id='', password='')

For developer

The project is managed by Poetry. Therefore, make sure that Poetry is installed in your system. Then run

$ poetry install

to install all dependencies. With this command, Poetry also install the package in editable mode.

Create FDO

To create an FAIR Digital Object (FDO), please follow these three steps:

  1. Execute the following command to create a Digital Object (DO) of the data bitstream. Note down the ID of the created DO.

    $ doipy create <file> --md-file <md-file> --client-id <client-id> --password <password>
    
  2. Create a DO of the metadata bitstream. Note down the ID of the created DO.

    $ doipy create <metadata-file> --md-file <md-metadata-file> --client-id <client-id> --password <password>
    
  3. Create the FDO.

    $ doipy create_fdo <id-data-DO> <id-metadata-DO> --client-id <client-id> --password <password>
    

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

doipy-0.2.1.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

doipy-0.2.1-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

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