Skip to main content

Context

Record Keeper (abbreviated to RK) is aimed at two broad goals:

  1. Explaining why something happened in your platform. Common example that we want to support is: why event X happened at time T? What Models were used? Who trained them, using training data ingested from which datasources? It achieves it by creating graph of events.

  2. Recreating platform state at that time.

Basics

RKClient library is used to create events (PEMS) and inform RK about them.

You will need a running Record Keeper Event Receiver to be able to work with it.

Recommended usage:

emitter_id = uuid.UUID('..some static uuid..')
rk_receiver = os.environ.get('RK_RECEIVER')

rk_client = RKClientFactory.get(rk_receiver, emitter_id)

By using factory, automatically when RK_MOCK=true env variable will be defined, the returned client will fake the connections and return only success codes.

Details

The Receiver will be configured with max PEM payload size. If your PEM exceeds this limit, it will be rejected (with explanation).

You can query for the PEM limit size in get_info(), in pem_size_limit field.

API

RKClient:

  • prepare_pem
  • prepare_artifact
  • send_pem
  • set_tag

RKQuery:

  • get_pems
  • get_pems_count
  • get_artifact
  • get_artifacts
  • get_artifacts_count
  • get_tag
  • get_tags
  • get_tags_count
  • get_info

RKAdmin:

  • check_connections
  • query_graph
  • clean_dbs
  • graph_rebuild
  • graph_flush
  • graph_verify
  • get_graph_info
  • get_report
  • artifacts_verify_connections
  • artifacts_remove_unconnected

Authenticating

If you want to do anything more than sending a PEM, you will need to pass a RK authentication credential when creating RKClient or RKAdmin.

There are two types:

  1. User auth
  2. PUC auth

First is available in Record Keeper Dashboard, in your user profile. It's intended to be used in tests.

Machine code on production should rather use PUC-auth, since it's user agnostic. However, you will need to ask RK admin to create the PUC and send you its auth code.

RKClient from Python console

cd rkclient/
python3
>>> from rkclient import RKQuery
>>> rk = RKQuery('http://127.0.0.1:8082/receiver/')
>>> pems, msg, ok = rk.get_pems()
>>> assert ok, msg
>>> for pem in pems:
>>>   print(pem)

Changelog

[3.5.0] - 2023-10-26

  • RKAdmin new functions: artifacts_verify_connections, artifacts_remove_unconnected, get_report

[3.4.0] - 2023-09-19

  • Added separate ReceiverInfo and QueryInfo classes.
  • RKQuery is using Query component.
  • Removal of Taxonomies feature.
  • RKClient, RKQuery and RKAdmin catch all exceptions and turn them to error returned by result.

[3.3.0] - 2023-08-14

  • PEM is sent without TimestampReceived field.

[3.2.1] - 2023-06-12

  • Version updated to match other components

[3.2.0] - 2023-06-07

  • Moved "getter" functions to new class RKQuery. RKAdmin is left with truly low-level functions.
  • Added helper function RKQuery.get_artifact_latest().

[3.1.0] - 2023-04-06 and 2023-05-17

  • Improved error logging, by creating less irrelevant logs.
  • Add default User-Agent to requests to be equal to recordkeeper-client-{version}.
  • RKAdmin supports /info and /verify endpoints of GraphBuilder.

[3.0.0] - 2023-02-06

  • Changed Artifact id field from uuid to string. This forces changes in many functions API.
  • Changed Emitter field from uuid to string.
  • RKClient get_artifacts() supports returning artifacts with properties, from graph.

[2.1.0] - 2022-12-20

  • Adjust default RK_RECEIVER URLs to use shallower path: <ip>:<port>/receiver/, instead of <ip>:<port>/recordkeeper/receiver/
  • Removed ping() function.
  • Added deserialize_info() function for converting result of get_info() to Info class.
  • Removed postgres_enabled and neo4j_enabled flags from Info.

[2.0.0] - 2022-11-18

  • Make it possible to control GraphBuilder through RKAdmin.
  • Refactor requests code.
  • RKAdmin new check_connections method.

[1.9.1] - 2022-09-20

  • Version updated to match other components

[1.9.0] - 2022-09-13

  • Added async test.

[1.8.0] - 2022-02-23

  • Support for PUC auth type.
  • New function get_tags_count.

[1.7.0] - 2022-02-23

  • RKClient catches timeout exception.
  • Artifact instances in python can be compared using equal operator.

[1.6.1] - 2022-01-26

  • PEM deduplicates uses artifacts.
  • Fix for function behaviour in mocked RKClient.

[1.6.0] - 2022-01-17

  • Removed PEM User field, bumped PEM version to 1.0.1

[1.5.0] - 2021-12-21

  • Version updated to match other components

[1.4.0] - 2021-11-16

  • Version updated to match other components

[1.3.0] - 2021-09-06

  • Remove the requests dependency

[1.2.3] - 2021-08-26

  • Bump the requests version to 2.26.*

[1.2.2] - 2021-06-17

  • Option to disable SSL cert verification

[1.2.1] - 2021-06-8

  • Official release on Pypi, added license

RKClient is part of ERST Record Keeper repository.

RKClient is licensed with GNU General Public License version 3 or later, see LICENSE file for details.

Record Keeper is ERST's implementation of the Context Cartographer specification.

Metadata

Release files for RecordKeeper-Client 3.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RecordKeeper-Client 3.5.0
File Size Uploaded Provenance Actions
RecordKeeper_Client-3.5.0.tar.gz 26.0 kB Without provenance Details for RecordKeeper_Client-3.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RecordKeeper-Client 3.5.0
File Interpreter ABI Platform Actions
RecordKeeper_Client-3.5.0-py3-none-any.whl Python 3 none any Details for RecordKeeper_Client-3.5.0-py3-none-any.whl

Total release size: 54.0 kB

Release files / RecordKeeper_Client-3.5.0.tar.gz

Download URL RecordKeeper_Client-3.5.0.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8658d5d68574f8b345cb1a94d297006496f944eba824c95f695212fd61a53916
BLAKE2b-256 checksum
How to use checksums
bf9327ea7bee398e33cf143ae2871dca183318fc89fffcf36e4a450a063cd0ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / RecordKeeper_Client-3.5.0-py3-none-any.whl

Download URL RecordKeeper_Client-3.5.0-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1936c120d98e9ff77c68b7bf84153a7a27f8fdc4e5b3326102fc067c27574659
BLAKE2b-256 checksum
How to use checksums
acecfe5e815e6e13d362dd779af91496550bd25e7f281d784eaf8facb0a312d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for RecordKeeper-Client 3.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page