Add to satisfy missing IPM JSON-tooling dependencies observed in a clean installation.rpds-py
Document IPM's option to prevent stale package code when pip installs into a shared target directory. This option can upgrade dependencies shared with other applications, and old directories may still remain.-extra-pip-flags "--upgrade".dist-info
Use the same Python dependency list for Docker builds and IPM installations.
Add a packaging check for the required dependency.
Load a Kaggle dataset into InterSystems IRIS tables with one line of ObjectScript.
Every CSV and Parquet file of the dataset becomes its own table.
Built for InterSystems Community Bounty Round 3, idea DPI-I-1012.
do ##class(dc.kaggleloader.Loader).Load("unsdsn/world-happiness")
One call downloads the dataset from Kaggle and creates one IRIS table per data file.
You need Docker with Compose v2 and internet access.
Clone the repository and start the container:
git clone https://github.com/boanerges1227/iris-kaggle-import.git
cd iris-kaggle-import
docker compose up -d --build --wait
docker compose exec iris iris session IRIS -U USER
Then run the ObjectScript example shown above in the IRIS terminal.
The container exposes ports 21975 (SQL) and 52997 (web). Login: _SYSTEM / SYS, namespace USER.
Compose defaults to the public intersystems/irishealth-community:2026.2 image.
Set IRIS_IMAGE to use another compatible image. The default credentials are for
local evaluation only.
do ##class(dc.kaggleloader.Loader).Load("unsdsn/world-happiness")
Full signature:
Load(handle, target="", limit=0, mode="replace")
| Argument | Default | Description |
|---|---|---|
handle |
(required) | Kaggle dataset: owner/name (latest) or owner/name/versions/N (pinned) |
target |
"KaggleData.<name>" |
Target schema.tablePrefix — each file becomes <prefix>_<filename> |
limit |
0 |
Max rows per file; 0 = all |
mode |
"replace" |
replace / append / fail |
Returns a JSON summary listing every table, its row count and inferred column types. The following is an excerpt:
{"status":"success","dataset":"unsdsn/world-happiness","pinned":false,"rowsWritten":782,
"tables":[{"file":"2015.csv","table":"KaggleData.world_happiness_2015","rows":158,"columns":12}],
"notImported":[]}
write ##class(dc.kaggleloader.Loader).Info("unsdsn/world-happiness")
Lists the data files without importing them.
;; latest version, default schema KaggleData do ##class(dc.kaggleloader.Loader).Load("unsdsn/world-happiness");; pinned version do ##class(dc.kaggleloader.Loader).Load("parulpandey/palmer-archipelago-antarctica-penguin-data/versions/1")
;; custom target prefix, first 100 rows of each file do ##class(dc.kaggleloader.Loader).Load("unsdsn/world-happiness", "Demo.happy", 100)
;; error if tables already exist do ##class(dc.kaggleloader.Loader).Load("unsdsn/world-happiness", "", 0, "fail")
Most public datasets need no credentials. For datasets requiring consent or private datasets,
export your Kaggle API credentials before starting the container:
KAGGLE_USERNAME=your_user KAGGLE_KEY=your_key docker compose up -d --wait
# or
KAGGLE_API_TOKEN=your_token docker compose up -d --wait
Create credentials at kaggle.com/settings → API → Create New Token.
.csv and .parquet file becomes its own table <schema>.<prefix>_<filename>;notImported and skipped.BIGINT, if every value parses as a number it becomes DOUBLE,true/false becomes BIT, otherwise VARCHAR(4000). Leading zeros are preserved00123 stays 00123). An empty field becomes NULL.BIGINT, floats → DOUBLE,TIMESTAMP, nested types → JSON text).[a-z0-9_]; SQL reserved words get a trailing _.replace mode rebuild the tables; a failed import returns{"status":"error"} with the file and reason — rows are never skipped silently.KAGGLE_MAX_ROWS / KAGGLE_MAX_FILE_MB).replace can remove an existing table before a later error. Use a dedicated schema| Parquet Type | IRIS Type |
|---|---|
| int8..int64, uint8..uint64 | BIGINT |
| float, double | DOUBLE |
| bool | BIT |
| date | DATE |
| timestamp | TIMESTAMP |
| string, list, struct, other | VARCHAR(4000) (JSON for nested) |
| Handle | Result |
|---|---|
unsdsn/world-happiness |
5 tables (world_happiness_2015..2019), 782 rows |
unsdsn/world-happiness/versions/2 |
same, "pinned": true |
kagglehub>=0.3, pyarrow>=14.0, rpds-py>=0.7.1On an existing IRIS instance with IPM installed, network access, and permission to
install Python packages into the instance’s Python directory:
zpm "load /path/to/iris-kaggle-import -extra-pip-flags ""--upgrade"""
IPM installs the Python dependencies from requirements.txt and copies the loader
module into the instance’s Python library directory. The --upgrade flag is important:
IPM installs into the shared mgr/python directory, and without it pip may leave old
package files in place even after installing newer metadata. This can upgrade shared
dependencies used by other applications; verify compatibility on an existing instance.
rpds-py is included for IPM installations that lack a dependency of its JSON tooling.
With pip’s --target installation, older .dist-info directories may remain even
after the importable package is upgraded; check the actual loaded version as well as
pip check. Do not delete shared metadata without checking other applications.
After version 1.0.1 is published to the IPM registry, use:
zpm "install iris-kaggle-import -extra-pip-flags ""--upgrade"""
./tests/test.sh
Runs six independently checked acceptance cases and a SQL row-count check against the running container and accesses Kaggle; it creates
and replaces tables in the KaggleData schema, so use a disposable instance.
Regression tests can also be run inside the container:
docker compose exec -T iris python3 -m unittest discover -s /home/irisowner/dev/tests -p test_regressions.py -v
python3 -m unittest discover -s tests -p test_acceptance_parser.py -v
MIT. Every dataset keeps its own license and terms — check them before you load or share data.
No dataset is bundled with this repository.