From c6121a2ccb1ec364d6add28988a15a541db326f1 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Tue, 29 Apr 2025 20:05:48 +0200 Subject: [PATCH 1/2] json docs --- .../topics/gettingStartedGradleAdvanced.md | 13 +++++++++++++ docs/StardustDocs/topics/parse.md | 2 +- docs/StardustDocs/topics/read.md | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md b/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md index f1206d9d8b..d64376a5ce 100644 --- a/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md +++ b/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md @@ -124,6 +124,7 @@ dependencies { // Artifact containing all APIs and implementations implementation("org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%") // Optional formats support + implementation("org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%") implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%") implementation("org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%") implementation("org.jetbrains.kotlinx:dataframe-jdbc:%dataFrameVersion%") @@ -149,6 +150,8 @@ dependencies { // Artifact containing all APIs and implementations implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%' // Optional formats support + implementation 'org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%' + implementation 'org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%' implementation 'org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%' implementation 'org.jetbrains.kotlinx:dataframe-jdbc:%dataFrameVersion%' implementation 'org.jetbrains.kotlinx:dataframe-arrow:%dataFrameVersion%' @@ -168,6 +171,16 @@ dependencies { + +`dataframe-json` is included with `dataframe-csv` and `dataframe-excel` by default. This is to interact with +JSON structures inside CSV and Excel files. If you don't need this functionality, you can exclude it like: +```kts +implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%") { + exclude("org.jetbrains.kotlinx", "dataframe-json") +} +``` + + #### Linter configuration We provide a Gradle plugin that generates interfaces with your data. diff --git a/docs/StardustDocs/topics/parse.md b/docs/StardustDocs/topics/parse.md index d7b5ea9583..c28cba485f 100644 --- a/docs/StardustDocs/topics/parse.md +++ b/docs/StardustDocs/topics/parse.md @@ -43,7 +43,7 @@ df.parse { age and weight } * [`Double` (with optional locale settings)](#parsing-doubles) * `Boolean` * `BigDecimal` -* `JSON` (arrays and objects) +* `JSON` (arrays and objects) (requires the `org.jetbrains.kotlinx:dataframe-json` dependency) ### Parser Options diff --git a/docs/StardustDocs/topics/read.md b/docs/StardustDocs/topics/read.md index 14082d09f4..28167eee13 100644 --- a/docs/StardustDocs/topics/read.md +++ b/docs/StardustDocs/topics/read.md @@ -286,6 +286,14 @@ val df = DataFrame.readCsv( ## Read from JSON +Before you can read data from JSON, make sure you have the following dependency: + +```kotlin +implementation("org.jetbrains.kotlinx:dataframe-json:$dataframe_version") +``` + +It's included by default if you have `org.jetbrains.kotlinx:dataframe:$dataframe_version` already. + To read a JSON file, use the `.readJson()` function. JSON files can be read from a file or a URL. Note that after reading a JSON with a complex structure, you can get hierarchical From 9e5e1549c2fb949a0f486b4a9ebf8982aab4e438 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Wed, 30 Apr 2025 13:05:40 +0200 Subject: [PATCH 2/2] changed warning to note --- docs/StardustDocs/topics/gettingStartedGradleAdvanced.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md b/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md index d64376a5ce..9f3e93105a 100644 --- a/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md +++ b/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md @@ -171,7 +171,7 @@ dependencies { - + `dataframe-json` is included with `dataframe-csv` and `dataframe-excel` by default. This is to interact with JSON structures inside CSV and Excel files. If you don't need this functionality, you can exclude it like: ```kts @@ -179,7 +179,7 @@ implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%") { exclude("org.jetbrains.kotlinx", "dataframe-json") } ``` - + #### Linter configuration