I'd like to share an example on how the new Embedded Python feature in IRIS helped me in my daily routines.
While I’m participating in the iris-kaggle-socrata-generator project with Henrique Dias, I got to unzip datasets from Kaggle in order to import them.
Such a task was easily achieved by using the zipfile lib in Python (this code was copied from this stackoverflow):
Method UnZip(pZipFileName As %String, pExtractToDir As %String) As %DynamicArray [ Language = python ]
{
import zipfile
import iris
with zipfile.ZipFile(pZipFileName, 'r') as zip_ref:
zip_ref.extractall(pExtractToDir)
fileList = zip_ref.namelist()
dynarray = iris.cls("%DynamicArray")._New()
for file in fileList:
dynarray._Push(file)
return dynarray
}
.png)

