Skip to content

invenio module for custom ultraviolet commands

License

Notifications You must be signed in to change notification settings

nyudlts/ultraviolet-cli

Repository files navigation

ultraviolet-cli

Invenio module for custom Ultraviolet commands

Prerequisites

Install and run locally

  • Please make sure OpenSSL >= 1.1.0 on your machine. Install/Update of OpenSSL varies from one machine to another.
  • Clone the repository
    git clone [email protected]:nyudlts/ultraviolet-cli.git && cd ultraviolet-cli
  • Install & use specified python version
    pyenv install --skip-existing
  • Install python requirements in a project pip environment (pipenv)
    pip install --upgrade -U pip pipenv
    pipenv install
  • Invoke the ultraviolet-cli root command via pipenv
    pipenv run ultraviolet-cli

Create Communities

Usage

Usage: ultraviolet-cli create-communities [OPTIONS] NAME

  Create a community for Ultraviolet.

Options:
  -d, --desc TEXT                 A description of the community to be created
                                  [required]
  -t, --type [organization|event|topic|project]
                                  Type of the Community to be created.
                                  [default: organization]
  -v, --visibility [public|restricted]
                                  Visibility of the community.  [default:
                                  public]
  -p, --policy [open|closed]      Policy to be set for the members and records
                                  of the community.  [default: open]
  -o, --owner TEXT                Email address of the designated owner of the
                                  community.  [default: [email protected]]
  -g, --add-group TEXT            Automatically adds the Group to the
                                  community. Group/Role needs to be provided
                                  as input and needs to be created prior. Adds
                                  the given group as a reader by default.
  --help                          Show this message and exit.

Example

pipenv run ultraviolet-cli create-communities -d "Community for NYU students" -g "nyustudents" -o "[email protected]" "NYU Students Community"

The code assumes owner and the group are valid within Invenio, otherwise, they have to be created for the code to complete successfully.

Delete Records

Usage

Usage: ultraviolet-cli delete-record [OPTIONS] PID

  Delete Record from Ultraviolet.

Options:
  --help  Show this message and exit.

Example

pipenv run ultraviolet-cli delete-record pid1-sample

Upload Files

Usage

Usage: ultraviolet-cli upload-files [OPTIONS] PID

  Upload file for a draft.

Options:
  -f, --file PATH       File to be uploaded.
  -d, --directory PATH  Directory with the files to be uploaded.
  --help                Show this message and exit.

Example

pipenv run ultraviolet-cli upload-files -f file_path pid1-sample
pipenv run ultraviolet-cli upload-files -d dir_path pid1-sample

About

invenio module for custom ultraviolet commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published