Skip to main content

Manage objects in a CDSTAR instance through a catalog

Project description

cdstarcat

Build Status PyPI

Manage objects in a CDSTAR instance using a local catalog.

Install

Running

pip install cdstarcat

will install the cdstarcat package as well as a commandline interface cdstarcat.

For developing cdstarcat, clone the repository clld/cdstarcat and run

cd cdstarcat
pip install -r requirements.txt

CLI

Run

cdstarcat --help

to get a list of available subcommands, and

cdstarcat help SUBCOMMAND

to get usage information for a particular subcommand.

cdstarcat API

Typically, cdstarcat will be used programmatically, to implement recurring media file maintenance tasks within projects - such as uploading media files for a new submission to Dictionaria.

In the simplest case this could look as follows:

import os
from cdstarcat import Catalog

def upload(directory):
    with Catalog(
        os.environ['CDSTAR_CATALOG'],
        cdstar_url=os.environ['CDSTAR_URL'],
        cdstar_user=os.environ['CDSTAR_USER'],
        cdstar_pwd=os.environ['CDSTAR_PWD']
    ) as cat:
        md = {
            'collection': 'PROJECT NAME',
            'path': '%s' % directory,
        }
        for fname, created, obj in cat.create(directory, md):
            print('{0} -> {1}'.format(fname, obj.id))

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

cdstarcat-1.6.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

cdstarcat-1.6.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file cdstarcat-1.6.0.tar.gz.

File metadata

  • Download URL: cdstarcat-1.6.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cdstarcat-1.6.0.tar.gz
Algorithm Hash digest
SHA256 7cdf4d8018aac31707917e795ebcae478cb482d855dd5c773bc38238ae0972ae
MD5 d731379c473468dce3cdf0c98ab0a7b1
BLAKE2b-256 558415309a456d7326a5fa01319863b604ad6de78af6b525ec1745c4f1cbca3c

See more details on using hashes here.

File details

Details for the file cdstarcat-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: cdstarcat-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cdstarcat-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0852712788217266325507395240231dd4424b8e411445ee68c5771034fe6fda
MD5 84304a458f811895e4895cfb5100fdf1
BLAKE2b-256 28ecfbea02f6956f7ee8c29535daebeeb85f5aeada39a39262045e17844ccfd6

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