inline notifications-python-client

This commit is contained in:
Kenneth Kehl
2025-06-10 11:40:14 -07:00
parent f4795843cc
commit 30093673d0
38 changed files with 593 additions and 33 deletions

View File

@@ -0,0 +1,21 @@
import base64
DOCUMENT_UPLOAD_SIZE_LIMIT = 2 * 1024 * 1024
def prepare_upload(
f, filename=None, confirm_email_before_download=None, retention_period=None
):
contents = f.read()
if len(contents) > DOCUMENT_UPLOAD_SIZE_LIMIT:
raise ValueError("File is larger than 2MB")
file_data = {
"file": base64.b64encode(contents).decode("ascii"),
"filename": filename,
"confirm_email_before_download": confirm_email_before_download,
"retention_period": retention_period,
}
return file_data