Create and manage datasets
Textual uses datasets to produce files with sensitive values replaced.
Before you perform these tasks, remember to instantiate the SDK client.
Create and add files to a dataset
To create a new dataset and then upload a file to it, use textual.create_dataset
.
To add a file to the dataset, use dataset.add_file
. To identify the file, provide the file path and name.
To provide the file as IO bytes, you provide the file name and the file bytes. You do not provide a path.
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.edit
.
You can use dataset.edit
to change:
The name of the dataset
Get the current status of dataset files
To get the current status of the files in the current dataset, use dataset.describe
:
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:
File identifier and name
Number of rows and columns
Processing status
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_file
.
Get redacted content for a dataset
To get the redacted content in JSON format for a dataset, use dataset.fetch_all_json()
:
For example:
The response looks something like:
Last updated