Skip to content

json module docs #1164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/StardustDocs/topics/gettingStartedGradleAdvanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%")
Expand All @@ -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%'
Expand All @@ -168,6 +171,16 @@ dependencies {

</tabs>

<note>
`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")
}
```
</note>

#### Linter configuration

We provide a Gradle plugin that generates interfaces with your data.
Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions docs/StardustDocs/topics/read.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down