Provides an 'R' interface for building verifiable manifests around data, models, prompts, agents, computations, and related lineage. Exposes the public 'eqty-sdk' 'Python' package through types accessible from 'R' for creating assets, connecting computation inputs and outputs by content identifier, grouping statements in contexts, and exporting manifest JSON files.
The eqty.sdk.r is intended for data scientists, statisticians, ML engineers, and
teams that need a trustworthy record of how an output was produced. It records
the data, code, models, settings, and processing steps behind a result without
requiring the workflow's analytical logic to be rewritten. The resulting
Integrity Manifest can support review, audit, reproducibility, and
collaboration across teams and systems.
This package is an R package that makes the public
eqty-sdk Python SDK available to R
users.
reticulate 1.41 or newerInstall the released package and its R dependencies from CRAN:
install.packages("eqty.sdk.r")
To install the development version from a repository checkout:
install.packages("pak")
pak::local_install("package")
The package declares eqty-sdk>=2.4.1 and Python 3.10 or newer with
reticulate::py_require(). On first use, reticulate creates or reuses a managed
Python environment and installs the Python dependency from public PyPI. The
default setup does not require a separate pip command.
If RETICULATE_PYTHON, reticulate::use_python(), or another setting selects a
specific Python environment, that environment must already contain the Python
package:
reticulate::py_install("eqty-sdk")
library(eqty.sdk.r)
library(eqty.sdk.r)
ctx <- Context$new("Example R workflow")
invisible(integrity_init(default_context = ctx))
signer <- Signer$load_or_create(name = "example-r-signer")
invisible(integrity_set_active_signer(signer))
input_data <- data.frame(value = c(1, 2, 3))
input <- Dataset$with_context(ctx)$from_object(
input_data,
name = "Input values",
description = "Values to sum",
`_store` = TRUE
)
summary_data <- data.frame(total = sum(input_data$value))
output <- Dataset$with_context(ctx)$from_object(
summary_data,
name = "Summary",
description = "Calculated total",
`_store` = TRUE
)
invisible(
Computation$with_context(ctx)$new(
name = "Calculate total",
description = "Sums the registered input values"
)$add_input_cid(
input$cid
)$add_output_cid(
output$cid
)$finalize()
)
invisible(ctx$export(integrity_path("manifest.json")))
cat("Manifest written to manifest.json\n")
Review the important usage notes below before storing asset content.
This section provides a concise introduction to the main objects and workflows. Use the generated R help for the supported R API, signatures, options, and behavior. The Python SDK documentation describes the underlying implementation; it is not the source for R syntax and does not replace the R interface.
The provenance engine, asset models, content identifiers, signing, and
manifest operations are implemented by the Python SDK. The R package loads
that implementation through reticulate and exposes it through R-accessible
types and helpers.
Dataset, Code, Model, Document, Prompt,
Agent, and Configuration.Context graphs that group related assets, computations, and statements.Computation builders and integrity_compute() for R functions.Service integration for EQTY Governance Studio workflows.These bindings let an R workflow identify the assets it consumed, record the operations it performed, and connect them to the outputs it produced. The package handles the R-to-Python setup and value conversion needed by common SDK operations, allowing the workflow to remain in R while using the Python SDK's data model and manifest format.
Create an asset with from_path() when a file or directory is the artifact,
from_object() for an in-memory R value, or from_cid() when an existing CID
is authoritative. The resulting $cid changes when the content changes.
EQTY content identifiers use the IPFS CID format. A CID is self-describing: it encodes its version, content codec, hash algorithm, and hash digest. Using this format does not upload the asset to IPFS or make it publicly available.
For a file registered with from_path(), you can verify its CID manually:
Copy the asset CID and remove the urn:cid: prefix, if present.
Paste the remaining value into the IPFS CID Inspector.
Confirm that the decoded multihash algorithm is BLAKE3 and copy its hexadecimal digest.
Calculate the BLAKE3 digest of the same file bytes with a tool such as
b3sum:
b3sum path/to/file
Compare the hexadecimal output from b3sum with the digest shown by the
CID Inspector. They should match when the file bytes are identical.
This direct comparison applies to file-content CIDs. Directories and in-memory objects require the same serialization and hashing rules used by the SDK, so hashing an individual file is not sufficient to reproduce their CIDs.
A Context defines a graph and manifest boundary. Context$export() writes
its statements and stored blobs to a JSON manifest. Context$import_manifest()
can load an existing graph into a later execution.
Every generated statement is attributed to the active signer's DID.
Signer$load_or_create() creates the named local signer on its first run and
loads the same identity on later runs. By default, its persistent state is
stored under .eqty_sdk/ in the working directory. Preserve and protect this
directory when the same signer identity must be used across runs, especially
in production environments.
Use Computation to connect explicit input and output CIDs. Use
integrity_compute() when an R function performs the recorded operation; the
wrapper registers the function as a Code asset and records its execution.
_store = TRUE copies asset content into local SDK storage and the
exported manifest. Do not use it for credentials, private keys, personal
data, confidential records, or other information that must not be shared.Code
asset or embedded in a manifest. Read secrets at runtime with Sys.getenv()
or from an approved secrets vault. Do not register .Renviron, vault
responses, or resolved secret values as assets..eqty_sdk/ directory contains local state and private signing keys.
Preserve it when signer identity must remain stable, restrict access to it,
and never commit or register it as an asset. Pass custom_dir to
integrity_init() when this state must be stored elsewhere.Service. For guidance on configuring Governance Studio or a remote
service, contact the maintainers.After installation, open the generated R reference with:
help(package = "eqty.sdk.r")
Package documentation is maintained as roxygen comments in package/R/*.R.
Generated package/man/*.Rd files are intentionally not committed.
From the repository root, install the build dependencies once:
install.packages(
c("reticulate", "roxygen2"),
repos = "https://cloud.r-project.org"
)
Build the source package and run the CRAN checks:
./build-package.sh --no-manual
The script deletes stale reference files, regenerates them, builds the source
tarball under dist/, and runs R CMD check --as-cran. Omit --no-manual
when TeX is installed and the PDF reference manual should also be checked.
Install the newly built package without hardcoding its version:
package_version="$(Rscript --vanilla -e \
'cat(read.dcf("package/DESCRIPTION")[1, "Version"])')"
R CMD INSTALL "dist/eqty.sdk.r_${package_version}.tar.gz"
Restart any existing R session before reinstalling so it does not retain the previous package namespace. Verify the installed version with:
Rscript -e \
'library(eqty.sdk.r); cat(as.character(packageVersion("eqty.sdk.r")), "\n")'
Run each sample from its own directory because samples use relative paths. For example, from the repository root:
(cd samples/01-basic-sample && Rscript sample-register.R)
On the first SDK operation, reticulate provisions the declared Python
dependency. When a specific Python environment was selected manually, install
eqty-sdk into that environment as described in
Python dependency management.
For a quicker development cycle that skips documentation generation, the tarball build, and package checks, install the source directory directly:
R CMD INSTALL package
The GitHub package-check workflow runs manually. Pushing a matching version
tag runs the same build and attaches the source tarball to a GitHub Release.
The generated .Rd files are included in that tarball.
Report suspected vulnerabilities according to the repository's security policy.