PROV 2 BigchainDB
Project description
Introduction
This python module provides three different clients to save W3C-PROV documents into a federation of BigchainDB nodes. All clients are implemented with respect to the proposed concepts from the masters thesis Trustworthy Provenance Recording using a blockchain-like database.
See full documentation at: prov2bigchaindb.readthedocs.io
Software Requirements
Python 3.5 or Python 3.6
Python development libraries
GCC and Make
A local rethinkdb server
Installation
PyPi
Install it by running:
pip install prov2bigchaindb
You can view prov2bigchaindb on PyPi’s package index
Source
# Clone project
git clone git@github.com:DLR-SC/prov2bigchaindb.git
cd prov2bigchaindb
# Setup virtual environment
pyenv env
source env/bin/activate
# Install dependencies and package into virtual enviroment
make setup
Usage
DocumentConceptClient
from prov2bigchaindb.tests.core import setup_test_files
from prov2bigchaindb.core import utils, clients
test_prov_files = setup_test_files()
prov_document = utils.to_prov_document(content=test_prov_files["simple2"])
doc_client = clients.DocumentConceptClient(account_id="ID", host="127.0.0.1", port=9984)
# Store a document
tx_id = doc_client.save_document(prov_document)
# Retrieve a document
doc = doc_client.get_document(tx_id)
GraphConceptClient
from prov2bigchaindb.tests.core import setup_test_files
from prov2bigchaindb.core import utils, clients
test_prov_files = setup_test_files()
prov_document = utils.to_prov_document(content=test_prov_files["simple2"])
graph_client = clients.GraphConceptClient(host="127.0.0.1", port=9984)
# Store a document
tx_ids = graph_client.save_document(prov_document)
# Retrieve a document
doc = graph_client.get_document(tx_ids)
RoleConceptClient
from prov2bigchaindb.tests.core import setup_test_files
from prov2bigchaindb.core import utils, clients
test_prov_files = setup_test_files()
prov_document = utils.to_prov_document(content=test_prov_files["simple2"])
role_client = clients.RoleConceptClient(host="127.0.0.1", port=9984)
# Store a document
tx_ids = role_client.save_document(prov_document)
# Retrieve a document
doc = role_client.get_document(tx_ids)
License
See LICENSE file
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
prov2bigchaindb-0.3.1.1.tar.gz
(15.0 kB
view hashes)