Skip to main content

Third-Party Python Modules

Cloudomation flows are written in Python 3.7. In addition to all standard Python modules several third-party modules are available.

Use Casesโ€‹

The third-party Python modules serve different purposes. Please refer to their individual documentation pages which are linked below.

Available Third-Party Python Modulesโ€‹

The following third-party Python modules are available to be used in your flow scripts:

Module nameDescriptionLinks
arrowBetter dates & times for Python
chevronA Python implementation of mustache
holidaysGenerate and work with holidays in Python
html5libStandards-compliant library for parsing and serializing HTML documents and fragments in Python
lxmlThe lxml XML toolkit for Python
markdownA Python implementation of John Gruberโ€™s Markdown with Extension support.
passlibThe Passlib Python Library
pdftotextSimple PDF text extraction
phonenumbersPython port of Google's libphonenumber
pycryptodomeA self-contained cryptographic library for Python
pyjwtJSON Web Token implementation in Python
pyotpPython One-Time Password Library
pyqueryA jquery-like library for python
python-dateutilUseful extensions to the standard Python datetime features
pytzWorld Timezone Definitions for Python
pyyamlPyYAML-based module to produce pretty and readable YAML-serialized data
ujsonUltra fast JSON decoder and encoder written in C with Python bindings

Contact us at to request additional Python modules.


Parse a PDF Fileโ€‹

You can access the content of PDF files directly in your flow script.

Access a date written in a PDF file
import re
import base64
import io
import pdftotext
import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
pdf_name = 'example.pdf'
# Open the Cloudomation file object
pdf_file = system.file(pdf_name)
# Files contain binary content which is returned base64 encoded
file_base64 = pdf_file.get('content')
file_bytes = base64.b64decode(file_base64)
# Construct a `PDF` object from the bytes
pdf = pdftotext.PDF(io.BytesIO(file_bytes))
# Access the text of the first page of the PDF file
pdf_text = pdf[0]
# Clear the PDF object, so that the file object is closed
pdf = None
# Use a Regex to find the date
the_date ='Date:\s*(\d{4}-[01]\d-[0-3]\d)', pdf_text).group(1)
return this.success('all done')

Work with CSV Filesโ€‹

You can use the csv module to read CSV files into Python objects or write Python objects into CSV files.

Create a CSV file and send it by email.
import base64
import csv
import io
import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
fake_data_list = [
{'name': 'spam', 'number': 1},
{'name': 'eggs', 'number': 2},
{'name': 'foo', 'number': 3},
{'name': 'bar', 'number': 4},
result_file = io.StringIO()
csv_writer = csv.DictWriter(
fieldnames=['name', 'number'],
for data in fake_data_list:
csv_content = result_file.getvalue()
result_file = None
csv_writer = None


subject= 'Result',
text='See the attached file',
password= '****',
smtp_host= '',
smtp_port= 587,
use_tls= True,
attachments= [

return this.success('all done')