Manage objects in a CDSTAR instance through a catalog
Project description
cdstarcat
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
Release history Release notifications | RSS feed
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.2.0.tar.gz
(9.6 kB
view hashes)
Built Distribution
cdstarcat-1.2.0-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for cdstarcat-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0587cbb4605fe076c5024c44adbe92fd1c940abb8780d260a3e04ee0cbd2502 |
|
MD5 | 9a77cf70d2d3a7d1253e9b2dbcf9093e |
|
BLAKE2b-256 | e90579d5dea187d86706ba089f2ae533ce6afd4811ce9762ac9a075a858f6215 |