Skip to main content

TextGrid repository administration cli tool, based on tgclients

Project description

tgadmin

A command line tool for managing your projects in the TextGrid repository without TextGridLab.

Install

You may use this with venv or with pipx. With pipx you have the benefit of having the command available in your shell without further manual venv creation and activation.

Install pipx, e.g. on Debian/Ubuntu apt install pipx

And the this tool from pypi.org

    pipx install tgadmin

Upgrade to a new version with

    pipx upgrade tgadmin

If you do not want to use pipx have a look at the section "Development".

Usage

Export sessionID (SID)

get from https://textgridlab.org/1.0/Shibboleth.sso/Login?target=/1.0/secure/TextGrid-WebAuth.php?authZinstance=textgrid-esx2.gwdg.de

and set as env var:

    export TEXTGRID_SID=your_secret_sid_here

or set with --sid for every command

Get help

    tgadmin

List projects

list your projects:

    tgadmin list

Create project

if there is no suitable project, create one:

    tgadmin create lab-import-test-20230605

Upload an aggregation object like editons, aggregations and collections

You can upload aggregations as new textgrid objects like

    tgadmin --server http://test.textgridlab.org put-aggregation TGPR-...fe eng003.edition

this would assume that you have an file containing the aggragtion with local paths in eng003.edition and metadata description files like eng003.edition.meta. After initial uploads you find an filename.imex which has a mapping of lokal file names to textgrid URIs. This can be used to update the objects from the edition like:

    tgadmin --server http://test.textgridlab.org update-imex eng003.edition.imex .

Advanced Usage

You may use the development or the test instance of the TextGrid Server.

To use tgadmin with the test instance do

    tgadmin --server https://test.textgridlab.org list

for the dev system there is a shortcut, you may call

    tgadmin --dev list

shell completion

    _TGADMIN_COMPLETE=bash_source tgadmin > tgadmin-complete.bash
    . tgadmin-complete.bash

Development

clone repo

    git clone https://gitlab.gwdg.de/dariah-de/textgridrep/tgadmin.git
    cd tgadmin

and create venv

    python3 -m venv venv
    . venv/bin/activate
    pip install --editable .[dev]

afterwards tgadmin is in your venv as command and can be executed

    tgadmin

run integration tests and check coverage

    export PROJECT_ID=[my-project-id]
    export TEXTGRID_SID=[my-session-id]
    coverage run -m pytest --junitxml=report.xml && coverage html

Contributing

Commit convention:

Style constraints:

Coding constraints:

For your convenience, pre-commit hooks are configured to check against these constraints. Provided, you have installed the development requirements (see above), activate pre-commit to run on ever y git commit:

    pre-commit install

Badges

REUSE status PyPI

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

tgadmin-0.28.1.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

tgadmin-0.28.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file tgadmin-0.28.1.tar.gz.

File metadata

  • Download URL: tgadmin-0.28.1.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for tgadmin-0.28.1.tar.gz
Algorithm Hash digest
SHA256 f86b1b47f87e9e90b90c7f95439c6ba4202baba5b1108db4c23a5647a96d20c4
MD5 ccfab377a6ff61d50bd13a61728b6dd3
BLAKE2b-256 bbc82320cc4a215301cf01af932c5d2b5b6aba90309e805b3c870eb58e771115

See more details on using hashes here.

File details

Details for the file tgadmin-0.28.1-py3-none-any.whl.

File metadata

  • Download URL: tgadmin-0.28.1-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for tgadmin-0.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45a7bd2b1a939c2e99fe0197fe5da31e51db14c3d5af670a75e305362e1e86dd
MD5 6204e8f8057d32052790752cc8c0125b
BLAKE2b-256 035595f4a6806018d9e9a8134a6fd33ce08d9a91555907117f791ae6490f719d

See more details on using hashes here.

Supported by

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