diff --git a/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md b/docs/StardustDocs/topics/gettingStartedGradleAdvanced.md index f1206d9d8b..9f3e93105a 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