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)
This installation may vary for different operating systems.
Link to Pypi package
Steps with venv activation:
sudo apt install python3-full
python3 -m venv venv
source venv/bin/activate
pip install <your-package>
From source (cloned repository)
-
Install Python and venv:
sudo apt update sudo apt install python3 python3-pip python3-venv git
-
Clone the repository:
git clone git@gitlab.ics.muni.cz:dataraptors/elter/dar-invenio-cli.git cd dar-invenio-cli
-
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Install the package:
pip install .
Configuration
Before using the features, you need to set up the configuration. The configuration initialization with api_token is
required.
dar-invenio-cli config init --api-token <your-api-token>
This init configuration is also possible with optional parameters: --base-api-url, --model and --community e.g.:
dar-invenio-cli config init --api-token <your-api-token> --base-api-url <your-base-api-url> --model <your-model> --community <your-community>
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>
The init script sets default values for the cli and you can see the actual configuration by running:
dar-invenio-cli config show
Usage
If you do not have configuration set up, the commands will prompt you to run the configuration initialization first.
Create a single draft
From a JSON file - you need to provide valid json with its metadata structure, otherwise the creation may fail:
dar-invenio-cli create draft --from-file /path/to/your/file.json
From a name - creates a draft with empty metadata except for the title:
dar-invenio-cli create draft --from-title "My Draft Name"
Create multiple drafts
From multiple JSON files:
dar-invenio-cli create drafts --from-files "/path/to/file1.json" --from-files "/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 files <draft_id> "/path/to/file1" "/path/to/file2"
Upload files from a folder to a draft
It uploads all files from the specified folder to the given draft - if you want to have it in one file, create and upload ZIP.
dar-invenio-cli upload folder <draft_id> "/path/to/your/folder"
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
The easiest way, how to deploy a new version is to bump the version in the setup.cfg and run the deploy pipline on GitLab.
Metadata
Release files for dar-invenio-cli 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dar_invenio_cli-0.2.7.tar.gz | 11.8 kB | Without provenance | Details for dar_invenio_cli-0.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dar_invenio_cli-0.2.7-py3-none-any.whl | Python 3 | none | any | Details for dar_invenio_cli-0.2.7-py3-none-any.whl |
Total release size: 26.6 kB
Release files / dar_invenio_cli-0.2.7.tar.gz
| Download URL | dar_invenio_cli-0.2.7.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53cfb7022e83f6a43a92b3760d5190803d53f533f5614f8fdf1eb2b7b4d48a19
|
|
BLAKE2b-256 checksum How to use checksums |
baebfeea7c6692aed5b4e089d7ef097df0c489d488e2f969f332db7aec499fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / dar_invenio_cli-0.2.7-py3-none-any.whl
| Download URL | dar_invenio_cli-0.2.7-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db394ca9058a6b47293326affc5501c8e97b79bc4e29834974363c5803c636c8
|
|
BLAKE2b-256 checksum How to use checksums |
2d77849e6d3795cce1ae8da57f6d5facedcdc4412a7602a5cba29954fdb4de01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for dar-invenio-cli 0.2.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.