Skip to content

Commit 1d8d41a

Browse files
authored
Merge pull request #1164 from Kotlin/json-post-exclude-docs
json module docs
2 parents faf0d91 + 9e5e154 commit 1d8d41a

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

docs/StardustDocs/topics/gettingStartedGradleAdvanced.md

+13
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ dependencies {
124124
// Artifact containing all APIs and implementations
125125
implementation("org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%")
126126
// Optional formats support
127+
implementation("org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%")
127128
implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%")
128129
implementation("org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%")
129130
implementation("org.jetbrains.kotlinx:dataframe-jdbc:%dataFrameVersion%")
@@ -149,6 +150,8 @@ dependencies {
149150
// Artifact containing all APIs and implementations
150151
implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%'
151152
// Optional formats support
153+
implementation 'org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%'
154+
implementation 'org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%'
152155
implementation 'org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%'
153156
implementation 'org.jetbrains.kotlinx:dataframe-jdbc:%dataFrameVersion%'
154157
implementation 'org.jetbrains.kotlinx:dataframe-arrow:%dataFrameVersion%'
@@ -168,6 +171,16 @@ dependencies {
168171

169172
</tabs>
170173

174+
<note>
175+
`dataframe-json` is included with `dataframe-csv` and `dataframe-excel` by default. This is to interact with
176+
JSON structures inside CSV and Excel files. If you don't need this functionality, you can exclude it like:
177+
```kts
178+
implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%") {
179+
exclude("org.jetbrains.kotlinx", "dataframe-json")
180+
}
181+
```
182+
</note>
183+
171184
#### Linter configuration
172185

173186
We provide a Gradle plugin that generates interfaces with your data.

docs/StardustDocs/topics/parse.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ df.parse { age and weight }
4343
* [`Double` (with optional locale settings)](#parsing-doubles)
4444
* `Boolean`
4545
* `BigDecimal`
46-
* `JSON` (arrays and objects)
46+
* `JSON` (arrays and objects) (requires the `org.jetbrains.kotlinx:dataframe-json` dependency)
4747

4848
### Parser Options
4949

docs/StardustDocs/topics/read.md

+8
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ val df = DataFrame.readCsv(
286286

287287
## Read from JSON
288288

289+
Before you can read data from JSON, make sure you have the following dependency:
290+
291+
```kotlin
292+
implementation("org.jetbrains.kotlinx:dataframe-json:$dataframe_version")
293+
```
294+
295+
It's included by default if you have `org.jetbrains.kotlinx:dataframe:$dataframe_version` already.
296+
289297
To read a JSON file, use the `.readJson()` function. JSON files can be read from a file or a URL.
290298

291299
Note that after reading a JSON with a complex structure, you can get hierarchical

0 commit comments

Comments
 (0)