-
Notifications
You must be signed in to change notification settings - Fork 5
Home
- a
python
environment (python version 3.6). Anaconda orvirtualenv
recommended. - set up
pynux
, CDL's wrapper for the Nuxeo API, inside your python environment - install
unicodecsv
inside you python environment - obtain an API token for Nuxeo and put it in your pynux config file
Each of these prerequisites is explained further below.
- "Anaconda" is a python distribution that will work on Windows, Mac, and Linux. This option is particularly recommended for our Windows users. We don't use the scientific packages that come with a full install of Anaconda, so installation of the
miniconda
distribution is recommended - -- OR --
- use of
virtualenv
is recommend with your system python. If you don't have thevirtualenv
you might need toeasy_install virtualenv
If you've installed miniconda
in Windows, here's a walkthrough of steps to establish the python environment:
- Open the Command Prompt from the Start menu
- Go to your home directory, e.g.
cd C:\Users\yourname\
- Establish the new python environment. In this example, "venv" is the name we're using to name the environment:
conda create -n venv python
- Activate that new python environment:
activate venv
In your python environment (e.g., venv), install nuxeo_spreadsheet
from https://github.com/ucldc/nuxeo_spreadsheet -- either by downloading the zip
file or checking out the repository with git
. For Windows users, this will install the nuxeo_spreadsheet
package in your home directory (e.g., C:\Users\yourname\nuxeo_spreadsheet).
git clone https://github.com/ucldc/nuxeo_spreadsheet.git
If you ever need to grab the most current version of the code, use git pull origin master
Make sure you are in your python environment (e.g., venv) and go into the nuxeo_spreadsheet directory.
cd nuxeo_spreadsheet
pip install -r requirements.txt
Follow the instructions in the link below. Google-Sheets-Set-Up
The process will involve using the Nuxeo API to import metadata in tab-delimited spreadsheet format. Access through the Nuxeo API is supported through basic and token authentication, as described at UCLDC Documentation.
For token authentication, you can use a bash script to get a token, e.g. https://nuxeo.cdlib.org/nuxeo/authentication/token?applicationName=API+ACCESS&deviceId=###.##.###.##&deviceDescription=&permission=rw
(indicate your public IP in the deviceId parameter).
Go back to the home directory cd C:\Users\yourname\
Create a configuration file named .pynuxrc
(no filename extension), with the API token; use a text editor, etc. to create the configuration file. You can use the "Auth Token" example file as a template. The only thing you'll need to add is the API token, replacing the value xxx
with the token.
Save the .pynuxrc
configuration file to the home directory on your workstation (e.g. in Windows, at C:\Users\yourname).
In your python environment (e.g., venv), run this command to confirm the connection:
(venv)$ nxls /
d0ba6352-44c6-4f25-b9f9-667131d3eaf2 /asset-library
992f30c0-318c-457c-a04a-921222c8ba89 /default-domain