Skip to main content

A CKAN extension for embedding Sketchfab models as views.

Project description

ckanext-sketchfab

Travis Coveralls CKAN Python

A CKAN extension for embedding Sketchfab models as views.

Overview

A Sketchfab view can be added to any resource, regardless of whether the original data are related to the model. The view can use either the resource's URL (if the resource links directly to a sketchfab model) or one can be specified when creating the view.

You can see some of the Natural History Museum's 3D scans on Sketchfab, and several examples of the plugin in use in this dataset on the Museum's Data Portal.

Installation

Path variables used below:

  • $INSTALL_FOLDER (i.e. where CKAN is installed), e.g. /usr/lib/ckan/default
  • $CONFIG_FILE, e.g. /etc/ckan/default/development.ini
  1. Clone the repository into the src folder:
cd $INSTALL_FOLDER/src
git clone https://github.com/NaturalHistoryMuseum/ckanext-sketchfab.git
  1. Activate the virtual env:
. $INSTALL_FOLDER/bin/activate
  1. Install the requirements from requirements.txt:
cd $INSTALL_FOLDER/src/ckanext-sketchfab
pip install -r requirements.txt
  1. Run setup.py:
cd $INSTALL_FOLDER/src/ckanext-sketchfab
python setup.py develop
  1. Add 'sketchfab' to the list of plugins in your $CONFIG_FILE:
ckan.plugins = ... sketchfab

Configuration

There are currently no configuration options for this extension.

Usage

After installing, the "Sketchfab" view type will become available for resource maintainers. Add the new view and provide the URL to a Sketchfab model where prompted.

Testing

Test coverage is currently extremely limited.

To run the tests in this extension, there is a Docker compose configuration available in this repository to make it easy.

To run the tests against ckan 2.9.x on Python3:

  1. Build the required images
docker-compose build
  1. Then run the tests. The root of the repository is mounted into the ckan container as a volume by the Docker compose configuration, so you should only need to rebuild the ckan image if you change the extension's dependencies.
docker-compose run ckan

The ckan image uses the Dockerfile in the docker/ folder which is based on openknowledge/ckan-dev:2.9.

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-sketchfab-2.0.0.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distributions

ckanext_sketchfab-2.0.0-py3.10.egg (5.3 kB view hashes)

Uploaded Source

ckanext_sketchfab-2.0.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

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