import csv in Intersystems IRIS using embedded python The analog of csvgen but written in embedded python.
It uses Community IRIS SQLAlchemy to make everything work.
USER>zpm "install csvgenpy"
w ##class(shvarov.csvgenpy.csv).Generate(filename_or_url, dest_table_name, [schema_name], [server=embedded_python_by_default], [append=0])
Parameters in brackets are optional.
USER>do ##class(shvarov.csvgenpy.csv).Generate("/home/irisowner/dev/data/countries.csv","countries")
USER>do ##class(shvarov.csvgenpy.csv).Generate("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv","titanic","data")
$ irispython /home/irisowner/dev/app/csvgen.py
or
import csvgen
generate('file.csv','dest_table_name','schema_name')
USER>zpm "test csvgenpy"
The repository is ready for collaboration using Docker
Clone/git pull the repo into any local directory
$ git clone https://github.com/intersystems-community/iris-embedded-python-template.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d