Skip to main content

Dar Invenio Command Line Interface

Project description

DAR-INVENIO-CLI

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

Installation

From PyPI (Recommended)

sudo apt install python3-full 
python3 -m venv venv
source venv/bin/activate
pip install <your-package>

From source (for developers)

This guide will walk you through installing dar-invenio-cli from a cloned repository on Linux and Windows.

Prerequisites

  • Git: You'll need Git to clone the repository. You can download it from git-scm.com.
  • Python: Python 3.8 or newer is required. You can download it from python.org.

Installation Steps

  1. Install Python and venv:

    sudo apt update
    sudo apt install python3 python3-pip python3-venv git
    
  2. Clone the repository:

    git clone git@gitlab.ics.muni.cz:dataraptors/elter/dar-invenio-cli.git
    cd dar-invenio-cli
    
  3. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  4. Install the package:

    pip install .
    

Configuration

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

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:

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:

dar-invenio-cli config show

Usage

Create a single draft

From a JSON file:

dar-invenio-cli create draft --from-file /path/to/your/file.json

From a name:

dar-invenio-cli create draft --from-name "My Draft Name"

Create multiple drafts

From multiple JSON files:

dar-invenio-cli create drafts --from-files /path/to/file1.json /path/to/file2.json

From a folder containing JSON files:

dar-invenio-cli create drafts --from-folder /path/to/your/folder

Upload files to a draft

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:

    python -m build
    
  2. Install twine:

    pip install twine
    
  3. Upload to PyPI:

    twine upload dist/*
    

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

dar_invenio_cli-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dar_invenio_cli-0.1.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file dar_invenio_cli-0.1.1.tar.gz.

File metadata

  • Download URL: dar_invenio_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dar_invenio_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a314cda069515b6cfcf49f2603826a8acf9ac9c03e245d492741cbc1f5fd3748
MD5 8ceef9debce281d7e181c01165650ab3
BLAKE2b-256 42ab0550a75fb96cb53e8abbd6ebef95b877f6e2d8f4b7fb65cb9ec356f604a2

See more details on using hashes here.

File details

Details for the file dar_invenio_cli-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dar_invenio_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b29e94fd94b443bb4b944358b5ff8ab5123d53906965c49e82a03cb1f38cd36c
MD5 9a9f3dde9d7a20109ee33a104a6b5d34
BLAKE2b-256 2ee03e8faa98e07fa5b9198a6ca24d3988e46cdab3a4b5e8093b2e162e8bfa94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page