Name Last Update
docker Loading commit data...
tests Loading commit data...
.gitlab-ci.yml Loading commit data...
LICENSE.txt Loading commit data...
README.md Loading commit data...
acls.py Loading commit data...
config_example.yml Loading commit data...
container.py Loading commit data...
fcrepo4.py Loading commit data...
fcrepotest.py Loading commit data...
fetch_acl.py Loading commit data...
setup.py Loading commit data...

fcrepo4.py

A simple Python 3 (not Python 2!) interface to Fedora Commons 4.

Install

To install:

Usage

Sample usage:

import fcrepo4

repo = fcrepo4.Repository(config='config.yml)

container = repo.get(path)
b = container.add_binary(source='file.jpg')

Sample code

See this sample script to upload spreadsheet data to Fedora 4.

Tests

Note that test_016_access.py assumes a couple of test users on the Fedora server.

A tomcat-users.xml with the correct users is in the tests/ directory. To install it, copy it to /var/lib/tomcat7/conf/ on the fcrepo machine and restart Tomcat (sudo service tomcat7 restart)