Skip to content

modules topic #1314

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions docs/StardustDocs/d.tree
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<toc-element topic="gettingStartedJupyterNotebook.md"/>
<toc-element topic="gettingStartedDatalore.md"/>
<toc-element topic="gettingStartedGradleAdvanced.md"/>
<toc-element topic="Modules.md"/>
</toc-element>
<toc-element topic="overview.md">
<toc-element topic="apiLevels.md">
Expand Down
163 changes: 163 additions & 0 deletions docs/StardustDocs/topics/gettingStarted/Modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Modules

Kotlin DataFrame is split into specific modules that give you the flexibility
to only use the modules you need.
In this topic you'll learn what these modules are and how to add module dependencies
to an existing Gradle/Maven project.

## Configure the repository

Kotlin DataFrame modules are available from the Maven Central repository.
To use them, add the appropriate dependency into your repositories mapping:

<tabs>
<tab title="Kotlin DSL">

```kotlin
repositories {
mavenCentral()
}
```

</tab>
<tab title="Groovy DSL">

```kotlin
repositories {
mavenCentral()
}
```

</tab>
</tabs>

## General Kotlin DataFrame dependency

If you don't need custom module adjustments, you can easily add a general dependency with
all [core Kotlin DataFrame modules](#core-kotlin-dataframe-modules) — `dataframe-core` and all officially
supported IO format modules, excluding [experimental ones](#experimental-kotlindataframe-modules).

<tabs>
<tab title="Kotlin DSL">

```kotlin
dependencies {
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
}
```

</tab>

<tab title="Groovy DSL">

```groovy
dependencies {
implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion%'
}
```

</tab>
</tabs>

## Core Kotlin DataFrame modules

Core Kotlin DataFrame modules are `dataframe-core`, which contains all logic
related to working with DataFrame,
and optional modules for supporting the most important IO types:

| Module | Function |
|-------------------|-------------------------------------------------------------------------------------------|
| `dataframe-core` | The [DataFrame](DataFrame.md) API and its implementation. |
| `dataframe-json` | Provides support for JSON format writing and reading. |
| `dataframe-csv` | Provides support for CSV format writing and reading. |
| `dataframe-excel` | Provides support for XSL/XLSX format writing and reading. |
| `dataframe-jdbc` | Provides support for JDBC data sources writing and reading. |
| `dataframe-arrow` | Provides support for [Apache Arrow](https://arrow.apache.org) format writing and reading. |

Add the required Kotlin DataFrame modules to your project's dependencies:

<tabs>
<tab title="Kotlin DSL">

```kotlin
dependencies {
implementation("org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%")

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

</tab>

<tab title="Groovy DSL">

```groovy
dependencies {
implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%'

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%'
}
```

</tab>

</tabs>

Note that `dataframe-json` is included with `dataframe-csv` and `dataframe-excel` by default.
This is to support JSON structures inside CSV and Excel files.
If you don't need this functionality, you can exclude it like so:

<tabs>
<tab title="Kotlin DSL">

```kotlin
dependencies {
implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%") {
exclude("org.jetbrains.kotlinx", "dataframe-json")
}
}
```

</tab>

<tab title="Groovy DSL">

```groovy
dependencies {
implementation('org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%') {
exclude group: 'org.jetbrains.kotlinx', module: 'dataframe-json'
}
}
```

</tab>

</tabs>


## Experimental KotlinDataFrame modules

These modules are experimental and may be unstable.

| Module | Function |
|-------------------------------|-------------------------------------------------------------------------------------------------------|
| `dataframe-geo` | Provides new API for working with geospatial data and IO for geographic formats (GeoJSON, Shapefile). |
| `dataframe-openapi` | Provides support for [OpenAPI JSON format](https://www.openapis.org) reading and writing. |
| `dataframe-openapi-generator` | Provides [schema generation](schemas.md) from OpenAPI specifications. Requires `dataframe-openapi`. |


## Kotlin DataFrame plugin

The Kotlin DataFrame compiler plugin enables support for [extension properties](extensionPropertiesApi.md)
in Gradle projects, allowing you to work with dataframes in a name- and type-safe manner.

See [Compiler Plugin setup](Compiler-Plugin.md#setup) for installation
and usage in Gradle project instructions.