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.2.tar.gz (5.1 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.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dar_invenio_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 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.2.tar.gz
Algorithm Hash digest
SHA256 ee7ff326def15ce726e5aad453d8f433b0d0e6a73fc59825619186ba309b5ca9
MD5 9d80e5b671e598a5e5a26a2ab5871dd0
BLAKE2b-256 309ae731b5cdbf150a4812751dca68623b223ab6703d845e0426663be3afb4b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dar_invenio_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 82a71991f05958de9980771f5c892ef06807ab6bd23c04e0512f89e21c89d21a
MD5 fb9d26474eaf00a2e6221542d97103e3
BLAKE2b-256 f6d58be944feb47bc1edba111e1c1f1526f014141d9e80856046f5542fad525f

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