Jitsuin Archivist Examples
Project description
archivist-samples
Sample python code that uses the archivist python SDK to manage particular types of assets such as 'doors', 'cards', 'containers' etc.
Installing the samples code
Python 3.6 and later versions are supported.
Use the standard python pip utility:
python3 -m pip install --user jitsuin-archivist-samples
and this will create 6 entry points:
- archivist_samples_door_entry
- archivist_samples_estate_info
- archivist_samples_signed_records
- archivist_samples_synsation
- archivist_samples_sbom
- archivist_samples_wipp
Pre-requisites
Add a token to the file credentials/.auth_token and set some environment vars to specify the archivist endpoint:
export ARCHIVIST="https://rkvst.poc.jitsuin.io"
export AUTHTOKEN_FILENAME=credentials/.auth_token
export NAMESPACE="unique label"
export VERBOSE=-v
export PROOF_MECHANISM="--proof-mechanism=SIMPLE_HASH"
If VERBOSE is "-v" debugging output will appear when running the examples. Otherwise leave blank or undefined.
PROOF_MECHANISM should be "KHIPU" or "SIMPLE_HASH". If unspecified the default is "SIMPLE_HASH"
NAMESPACE
If NAMESPACE is blank or unspecified, any assets events, locations will be visible to other users running the same examples on the same URL.
Each example creates assets,events,locations that are not visible to other examples. For example the door_entry assets,events etc are not visible to the synsation example.
Assets and locations are only created if they do not already exist according to namespace.
Due to restrictions attachments are always uploaded during every example execution.
Events are created every execution of an example - currently no check is done if the event already exists.
EXAMPLES
All examples use a common set of arguments:
export AUTH="-u $ARCHIVIST -t $AUTHTOKEN_FILENAME $VERBOSE $PROOF_MECHANISM"
export ARGS="$AUTH --namespace $NAMESPACE"
Door Entry Control
Some commands to simply create and manage doors and cards:
archivist_samples_door_entry $ARGS --create
archivist_samples_door_entry $ARGS --list all
archivist_samples_door_entry $ARGS --list doors
archivist_samples_door_entry $ARGS --list cards
archivist_samples_door_entry $ARGS --list 'Courts of Justice front door'
archivist_samples_door_entry $ARGS --list 'access_card_1'
Execute opening doors with a card:
archivist_samples_door_entry $ARGS --open "Courts of Justice front door,access_card_1"
archivist_samples_door_entry $ARGS --open "Courts of Justice front door,access_card_3"
archivist_samples_door_entry $ARGS --open "Courts of Justice front door,access_card_4"
archivist_samples_door_entry $ARGS --open "Courts of Justice front door,access_card_0"
archivist_samples_door_entry $ARGS --open "Courts of Justice front door,access_card_2"
archivist_samples_door_entry $ARGS --open "Bastille front door,access_card_2"
archivist_samples_door_entry $ARGS --open "City Hall front door,access_card_2"
archivist_samples_door_entry $ARGS --open "Gare du Nord apartments side door,access_card_2"
Manage assets and events and check for any inconsistencies
NB no namespace required ...
archivist_samples_estate_info $AUTH --quick-count
archivist_samples_estate_info $AUTH --double-check
Signed Records
archivist_samples_signed_records $ARGS --create 'samples'
archivist_samples_signed_records $ARGS --sign-message 'signature' 'samples'
archivist_samples_signed_records $ARGS --bad-sign-message 'signature' 'samples'
archivist_samples_signed_records $ARGS --check 'samples'
Synsation
archivist_samples_synsation initialise $ARGS --num-assets 100 --wait 1 --await-confirmation
archivist_samples_synsation charger $ARGS -s 20190909 -S 20200909 -f 9876
archivist_samples_synsation jitsuinator $ARGS -n tcl.ccj.001 --wait 1.0
archivist_samples_synsation wanderer $ARGS
archivist_samples_synsation analyze $ARGS
Software Bill of Materials
archivist_samples_sbom $ARGS
WIPP
archivist_samples_wipp $ARGS
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jitsuin-archivist-samples-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4441898f5fdba58cfb4a44723e7e44d3ebb44169f0a7b1467d24d38da06645a6 |
|
MD5 | cc2e28f8048c9be990b58ef1009206d9 |
|
BLAKE2b-256 | 88faeb7886d1f9cf205acd65273b5c6474f520532ce8775a1ac342401bb9e058 |
Hashes for jitsuin_archivist_samples-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fdff0a4081947d196ace6c311980ba34c2f708a56b2ea6bf130f0f431d76041 |
|
MD5 | bde43ca411d6d398c971f7119e2ccf8e |
|
BLAKE2b-256 | 2636f4da226cd5ac42273ca4ecd478c8cdb2a9f25146b3c6b217c67aa215bf41 |