there is:
frappe.utils.file_manager.add_attachments(doctype, name, attachments)
does it work for you?