Skip to main content

Manages data storage for CKAN/DCOR (import, symlink, etc.)

Project description

This plugin manages how data are stored in DCOR. There are two types of files in DCOR:

  1. Resources uploaded by users, imported from figshare, or imported from a data archive

  2. Ancillary files that are generated upon resource creation, such as condensed DC data, preview images (see ckanext-dc_view).

This plugin implements:

  • Data storage management. All resources uploaded by a user are moved to /data/users-HOSTNAME/USERNAME-ORGNAME/PK/ID/PKGNAME_RESID_RESNAME and symlinks are created in /data/ckan-HOSTNAME/resources/RES/OUR/CEID. CKAN itself will not notice this. The idea is to have a filesystem overview about the datasets of each user.

  • Import datasets from figshare. Existing datasets from figshare are downloaded to the /data/depots/figshare directory and, upon resource creation, symlinked there from /data/ckan-HOSTNAME/resources/RES/OUR/CEID (Note that this is an exemption of the data storage management described above). When running the following command, the “figshare-import” organization is created and the datasets listed in figshare_dois.txt are added to CKAN:

    ckan -c /etc/ckan/default/ckan.ini import-figshare
  • Populate an internal depot from RT-DC data stored in tar archives. This is part of an effort to have automated imports of RT-DC data from other sources. The idea is to move experimental data to the DCOR server in tar archives and DCOR can then populate the internal depot with it. The location of the internal depot is /data/depots/internal/ and it follows a very specific directory structure 201X/2019-08/20/2019-08-20_1126_c083de* where the path is generated from the acquisition date, time, and part of the hash (c083de) of the original data file. According to this scheme, all files with the same path stem belong to one dataset:

    • 2019-08-20_1126_c083de.sha256sums a file containing SHA256 sums

    • 2019-08-20_1126_c083de_v1.rtdc the actual measurement

    • 2019-08-20_1126_c083de_v1_condensed.rtdc the condensed dataset

    • 2019-08-20_1126_c083de_ad1_m001_bg.png an ancillary image

    • 2019-08-20_1126_c083de_ad2_m002_bg.png another ancillary image

    ckan -c /etc/ckan/default/ckan.ini depotize-archive
  • Import datasets from the internal depot. The previous command depotize-archive just populates the depot directory structure. To make the datasets available in CKAN, this step must be performed:

    ckan -c /etc/ckan/default/ckan.ini import-internal

Please make sure that the necessary file permissions are given in /data.

Installation

pip install ckanext-dcor_depot

Add this extension to the plugins and defaul_views in ckan.ini:

ckan.plugins = [...] dcor_depot
ckan.storage_path=/data/ckan-HOSTNAME
ckanext.dcor_depot.depots_path=/data/depots
ckanext.dcor_depot.users_depot_name=users-HOSTNAME

This plugin stores resources to /data:

mkdir -p /data/depots/users-$(hostname)
chown -R www-data /data/depots/users-$(hostname)

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

ckanext-dcor_depot-0.8.12.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

ckanext_dcor_depot-0.8.12-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-dcor_depot-0.8.12.tar.gz.

File metadata

  • Download URL: ckanext-dcor_depot-0.8.12.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ckanext-dcor_depot-0.8.12.tar.gz
Algorithm Hash digest
SHA256 701c7e45697a0861d017a48f4aed9ab196b74adb8ceb9049d683f107a7e88ab0
MD5 94efa7a11028b72f1daf4657d55dddb5
BLAKE2b-256 29ef7f82125ba66aa9bade5b8fcdd6e7fb0f94e5a26bd2dec1ad7c3a8c344baa

See more details on using hashes here.

File details

Details for the file ckanext_dcor_depot-0.8.12-py3-none-any.whl.

File metadata

  • Download URL: ckanext_dcor_depot-0.8.12-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ckanext_dcor_depot-0.8.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1722e9b87e2eac2648e4d3f3ddd3e57b92775660b9ba8bc55afbddcf62d63227
MD5 5dbeb1b8120ba4ea9b773b4a56b28e89
BLAKE2b-256 2b7f611637b3b245fc847f8ad32eb74552895b23995b0cfd2a418d4b1547999f

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page