The Python script described in this article modifies (enables/disables) the Delete After Retention (DAR) Compliance settings. It also has a provision to modify Retention Time (in Days) for a bucket.
Install Python 3+ version.
Install the Python requests module.
Download and execute the script: delete_after_retention.py
When the script is executed, a list of available regions is displayed. The script continues and requests the following information.
Wasabi Access Key
Wasabi Secret Access Key
Wasabi Bucket Name
Region
Enter information for each request (all are mandatory). If any information is missing or invalid, the script will terminate with an appropriate message.

After validating the input, the script will display the current compliance setting for the bucket, as shown in the lower half of the example below. If compliance is disabled on the bucket, the script will display the Compliance status and terminate. If a conditional hold is enabled through an API, the script will display the status for ConditionalHold.
Additional options (in the upper half of the screen) enable you to:
Delete after retention—Enter Y to enable DAR, as shown in the example. The script will display an additional prompt to modify the retention time. Enter the number of days for retention (14 in the example). Retention time should be greater than zero. If you do not modify the retention time, only the DAR flag will be modified. After setting the DAR flag to “true” on the bucket (as shown in the last line of the example), the script will display the status with modified compliance settings.
Disable delete after retention—Enter N to disable the DAR for the bucket. After setting this flag to “false” on the bucket, the script will display the status with modified compliance settings.
Quit (end) the script without action—Enter Q to terminate. The script will display the message "Program Ended..."
