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.5.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

cdstarcat-1.5.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cdstarcat-1.5.0.tar.gz
  • Upload date:
  • Size: 17.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.5.0.tar.gz
Algorithm Hash digest
SHA256 c6e41d39d6612e35e14edb4bb08eba6d87b69e0d931ceaad413d42751aefbdbd
MD5 a43e2bd23985c9512a20f1a4e8aff6f7
BLAKE2b-256 cb50cea9a96adb5abfb99c4a76e21996e3d4ea781e68b9f5fe770f006cabd5a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cdstarcat-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee8a1b67351b439b3beb406917b565c2d1834d1888056dbc73bb1e447a6453c
MD5 b65276ed630c5d9675f51c325362e2d4
BLAKE2b-256 8741ab73af139b98595e14095e6ff2df3ea4d98e1eb4578e7b28e9a969db7615

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