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
Built Distribution
File details
Details for the file cdstarcat-1.4.0.tar.gz
.
File metadata
- Download URL: cdstarcat-1.4.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b221cd6502283de5ea465c1a7dab2b006eee9b8ba88b8df2a5e18fbd75c083e |
|
MD5 | 43cab4aadbec5c4bd4892abe1a6c5988 |
|
BLAKE2b-256 | 73259c8225cdc371e8fa933a8c1e71c5c56e2f2d481141ced8e0dd35569c9122 |
File details
Details for the file cdstarcat-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: cdstarcat-1.4.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3c741a1d53594b66f9cf80d106ebf5e3eaafcbfe2e277fb5e173008142d3a40 |
|
MD5 | 103b132734a643f49d47713588649558 |
|
BLAKE2b-256 | e2196b344d76ef27e79813facf6999fcd32020fb1581d65bd2df47c419675562 |