Assette will soon block the ability to use Python “import” feature, and our clients are advised not to use this feature in any of their python data blocks. Instead, use Configuration Data Block, as shown in CalculationEnv Configuration Data Block.
Restricted Data Block Keywords & Built-in Functions #
Keywords are core language constructs handled by the parser. These words are reserved and cannot be used as identifiers. For more information regarding on Python Keywords, please consult official documentation. Likewise, Built-ins are a list of commonly used preloaded functions, constants, types, and exceptions. For more information on Python Built-ins, please consult official documentation.
The following keywords have restricted usage:
Restricted Python Keywords | Notes |
---|---|
read | |
response |
The following keywords are prohibited within Data Blocks:
Prohibited Python Keyword | Notes |
---|---|
import | Use Configuration Data Blocks and Data Block dependency instead |
return | Has no effect as all Data Block output is in JSON. Use “response” instead |
Supported Python Libraries (Whitelist) #
The following list of Python Libraries and are supported and whitelisted by Assette. Additional Python Libraries may be requested to be whitelisted by sending an email to clientservice@assette.com.
Importing a Python Library to a Data Block is done using Configuration Data Blocks. It is suggested to use the Calculation Environment Data Block as an example.
Python Library Name |
pandas |
numpy |
json |
base64 |
datetime |
matplotlib |
pyplot |
textwrap3 |
typing |
functools |
calendar |
pygal |
pygal-maps-world |
pytz |
random |
math |
html.parser |
SciPy |
decimal |