Textual uses datasets to produce files with sensitive values replaced.
Before you perform these tasks, remember to instantiate the SDK client .
Get your list of datasets
To get the complete list of datasets that you own, use textual.get_all_datasetsarrow-up-right .
Copy datasets = textual.get_all_datasets() Create and add files to a dataset
To create a new dataset and then upload a file to it, use textual.create_datasetarrow-up-right .
Copy dataset = textual . create_dataset ( '<dataset name>' ) To add a file to the dataset, use dataset.add_filearrow-up-right . To identify the file, provide the file path and name.
Copy dataset . add_file ( '<path to file>' , '<file name>' ) To provide the file as IO bytes, you provide the file name and the file bytes. You do not provide a path.
Copy dataset.add_file('<file name>',<file bytes>) Textual creates the dataset, scans the uploaded file, and redacts the detected values.
Configure a dataset
To change the configuration of a dataset, use dataset.editarrow-up-right .
You can use dataset.edit to change:
Alternatively, instead of specifying the configuration, you can use the copy_from_dataset parameter to indicate to copy the configuration from another dataset.
Get the current status of dataset files
To get the current status of the files in the current dataset, use dataset.describearrow-up-right :
The response includes:
The name and identifier of the dataset
The number of files in the dataset
The number of files that are waiting to be processed (scanned and redacted)
The number of files that had errors during processing
For example:
Get lists of files by status
To get a list of files that have a specific status, use the following:
The file list includes:
Number of rows and columns
For failed files, the error
When the file was uploaded
Delete a file from a dataset
To delete a file from a dataset, use dataset.delete_filearrow-up-right .
Get redacted content for a dataset
To get the redacted content in JSON format for a dataset, use dataset.fetch_all_json()arrow-up-right :
For example:
The response looks something like:
Last updated 9 months ago