Formal SDK
Project description
Formal Admin Python SDK
This is the Python SDK for the Formal Admin API.
Installing
pip install formal-sdk
Example Use
import os
from formal_sdk import Client, aa_service_pb2
if __name__ == '__main__':
path = ""
tagId = ""
datastoreId = ""
newClient = Client(os.environ.get('TEST_CLIENT_ID'),
os.environ.get('TEST_SECRET_KEY'))
# Create Inventory Tag
res = newClient.Service.CreateInventoryTag(
aa_service_pb2.CreateInventoryTagRequest(name='newtag'),
timeout=10,
)
# Get Inventory Tags
res = newClient.Service.GetInventoryTags(
aa_service_pb2.GetInventoryTagsRequest(),
timeout=10,
)
# Delete Tag
res = newClient.Service.DeleteInventoryTag(
aa_service_pb2.DeleteInventoryTagRequest(id=tagId),
timeout=10,
)
# Create Inventory Object
res = newClient.Service.CreateInventoryObject(
aa_service_pb2.CreateInventoryObjectRequest(datastore_id=datastoreId, object_type="sub-column",
sub_column=aa_service_pb2.CreateInventoryObjectRequest.SubColumn(path=path, name="name", sub_type="json")),
timeout=10,
)
# Update Inventory Object Tags
res = newClient.Service.UpdateInventoryObjectTags(
aa_service_pb2.UpdateInventoryObjectTagsRequest(datastore_id=datastoreId, path=path,
tags=[tagId]),
timeout=10,
)
# Update Column Lock Status
res = newClient.Service.UpdateColumnLockStatus(
aa_service_pb2.UpdateColumnLockStatusRequest(datastore_id=datastoreId, path=path,
validated=True),
timeout=10,
)
res = newClient.Service.UpdateColumnDataLabel(
aa_service_pb2.UpdateColumnDataLabelRequest(datastore_id=datastoreId, path=path,
data_label="email"),
timeout=10,
)
# Delete Inventory Object
res = newClient.Service.DeleteInventoryObject(
aa_service_pb2.DeleteInventoryObjectRequest(
datastore_id=datastoreId, path=path),
timeout=10,
)
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
formal-sdk-0.0.2.tar.gz
(14.2 kB
view hashes)
Built Distribution
formal_sdk-0.0.2-py3-none-any.whl
(15.5 kB
view hashes)
Close
Hashes for formal_sdk-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d0a92c3ce40b3f7362a0b39b12d2e460b78ad34e1bdf5fbc1e28daa562ec9d6 |
|
MD5 | 017abd3615115e72666323055dfaf957 |
|
BLAKE2b-256 | 1fbc4de38eccb7ba3e89a54349428bf48c873a5c7c149dcd75286f475d4bb2da |