Python client library for REGDATA RPS Engine.
Project description
Quick Start Guide rps-engine-client-python
This guide explains how to install and use the rps-engine-client-python library from PyPI to interact with the REGDATA's RPS Engine API.
Install the Library
Install the latest version from PyPI using pip:
pip install rps-engine-client-python
Configure Your Environment
The library requires configuration for authentication and engine connection.
The default location of the configuration file is the root project folder.
Using .Env file with Environment Variables
rps__engineHostName="https://your-rps-engine-url"
rps__identityServiceHostName="https://your-identity-url"
rps__clientId="YOUR_CLIENT_ID"
rps__clientSecret="YOUR_CLIENT_SECRET"
rps__timeout=30
external_source_files__rightsContextsFilePath=path/to/rights_contexts.json
external_source_files__processingContextsFilePath=path/to/processing_contexts.json
rights_contexts.json
{
"Admin": {
"evidences": [
{
"name": "Role",
"value": "Admin"
}
]
}
}
processing_contexts.json
{
"Protect": {
"evidences": [
{
"name": "Action",
"value": "Protect"
}
]
},
"Deprotect": {
"evidences": [
{
"name": "Action",
"value": "Deprotect"
}
]
}
}
Create a Python Script
Below is an example which uses the EngineFactory class for the engine connection, getting the contexts from a JSON file.
- Pay attention that the given arguments for the
rights_context_nameandprocessing_context_nameparameters are the names of keys from the rights_contexts.json and processing_contexts.json files above.
from Client.engine.engine_factory import EngineFactory
from Client.context_source import ContextSource
from Client.instance.rps_instance import RPSInstance
from Client.engine_context.processing_context import ProcessingContext
from Client.engine_context.rights_context import RightsContext
from Client.evidence import Evidence
from Client.value.rps_value import RPSValue
engine = EngineFactory.get_engine(context_source=ContextSource.JSON)
raw_first_name = RPSValue(instance=RPSInstance(className='User', propertyName='Name'), originalValue='Jonny')
request_context = engine.create_context().with_request_by_context_names(
rps_values=[raw_first_name],
rights_context_name='Admin',
processing_context_name='Protect')
request_context.transform_async()
print(f'Original: {raw_first_name.original}, Transformed: {raw_first_name.transformed}')
Run Your Script
python your_script.py
Additional Resources
For advanced usage, examples, and contribution guidelines, see the full documentation on GitHub.
For REGDATA Community Page see RPS Community.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rps_engine_client_python-1.0.8.tar.gz.
File metadata
- Download URL: rps_engine_client_python-1.0.8.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
353d9474213422cb7a7a8a3a1b7c564e0427b63fe7555323f9702eb47bfa9d86
|
|
| MD5 |
64d0fd906b088fd6587cc6ddfd27286c
|
|
| BLAKE2b-256 |
64f9789aef95a381b577001e2d7c7b01e5961275c8ac2d9cccba58c11b6409f0
|
Provenance
The following attestation bundles were made for rps_engine_client_python-1.0.8.tar.gz:
Publisher:
python-publish.yml on RegdataSA/rps-engine-client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rps_engine_client_python-1.0.8.tar.gz -
Subject digest:
353d9474213422cb7a7a8a3a1b7c564e0427b63fe7555323f9702eb47bfa9d86 - Sigstore transparency entry: 463930270
- Sigstore integration time:
-
Permalink:
RegdataSA/rps-engine-client-python@12ffc449de6c5abcb1236d18ef2ddb01c8fb01ff -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/RegdataSA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@12ffc449de6c5abcb1236d18ef2ddb01c8fb01ff -
Trigger Event:
release
-
Statement type:
File details
Details for the file rps_engine_client_python-1.0.8-py3-none-any.whl.
File metadata
- Download URL: rps_engine_client_python-1.0.8-py3-none-any.whl
- Upload date:
- Size: 41.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
843c1bf30b20aa0d88b391927e07d093e6d486307838e37d82ea844c842b1c18
|
|
| MD5 |
035f0350cfa9987e1607c4900df63834
|
|
| BLAKE2b-256 |
dd0b3de233d76a2b198edce3847278d13deeec656cdd93c9dd26e508af4566d9
|
Provenance
The following attestation bundles were made for rps_engine_client_python-1.0.8-py3-none-any.whl:
Publisher:
python-publish.yml on RegdataSA/rps-engine-client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rps_engine_client_python-1.0.8-py3-none-any.whl -
Subject digest:
843c1bf30b20aa0d88b391927e07d093e6d486307838e37d82ea844c842b1c18 - Sigstore transparency entry: 463930335
- Sigstore integration time:
-
Permalink:
RegdataSA/rps-engine-client-python@12ffc449de6c5abcb1236d18ef2ddb01c8fb01ff -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/RegdataSA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@12ffc449de6c5abcb1236d18ef2ddb01c8fb01ff -
Trigger Event:
release
-
Statement type: