Skip to content
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
26 changes: 19 additions & 7 deletions .github/workflows/archive-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- master
paths:
- 'examples/android-example/**'
- 'examples/kotlin-dataframe-plugin-example/**'
- 'examples/kotlin-dataframe-plugin-gradle-example/**'
- 'examples/kotlin-dataframe-plugin-maven-example/**'
workflow_dispatch:

jobs:
Expand All @@ -22,10 +23,16 @@
cd examples/android-example
zip -r ../../android-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*"

- name: Create kotlin-dataframe-plugin-example archive
- name: Create kotlin-dataframe-plugin-gradle-example archive
run: |
cd examples/kotlin-dataframe-plugin-example
zip -r ../../kotlin-dataframe-plugin-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*"
cd examples/kotlin-dataframe-plugin-gradle-example
zip -r ../../kotlin-dataframe-plugin-gradle-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*" ".idea/*"

- name: Create kotlin-dataframe-plugin-maven-example archive
run: |
cd examples/kotlin-dataframe-plugin-maven-example
zip -r ../../kotlin-dataframe-plugin-maven-example.zip . -x "*.git*" "target/*" ".idea/*"


- name: Checkout example-projects-archives branch
run: |
Expand Down Expand Up @@ -58,10 +65,15 @@

**Download:** [android-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/android-example.zip)

### Kotlin DataFrame Plugin Example
Example of using the compiler plugin for Kotlin DataFrame.
### Kotlin DataFrame Plugin Gradle Example
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.

**Download:** [kotlin-dataframe-plugin-gradle-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip)

### Kotlin DataFrame Plugin Maven Example
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.

**Download:** [kotlin-dataframe-plugin-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-example.zip)
**Download:** [kotlin-dataframe-plugin-maven-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-maven-example.zip)

---

Expand Down
49 changes: 42 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ Or manually specify the version:
> ```

Refer to the
[Get started with Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/gettingstartedkotlinnotebook.html)
[Setup Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/setupkotlinnotebook.html)
for details.

### Gradle

Add dependencies in the build.gradle.kts script:
Add dependencies in the `build.gradle.kts` script:

```kotlin
dependencies {
Expand All @@ -135,18 +135,53 @@ repositories {
}
```

Refer to
[Get started with Kotlin DataFrame on Gradle](https://kotlin.github.io/dataframe/setupgradle.html)
for detailed setup instructions (including Groovy DSL).

* You can also check the [Custom Gradle Configuration](https://kotlin.github.io/dataframe/setupcustomgradle.html) if you don't need certain formats as dependencies.
* For Android projects, see [Setup Kotlin DataFrame on Android](https://kotlin.github.io/dataframe/setupandroid.html).
* See [IDEA Gradle example projects](examples/idea-examples)
and [the Gradle project with the Kotlin DataFrame Compiler plugin](examples/kotlin-dataframe-plugin-gradle-example).

Refer to the
[Get started with Kotlin DataFrame on Gradle](https://kotlin.github.io/dataframe/gettingstartedgradle.html)
[Setup Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/setupkotlinnotebook.html)
for details.
Also, check out the [custom setup page](https://kotlin.github.io/dataframe/gettingstartedgradleadvanced.html)
if you don't need some formats as dependencies,
for Groovy, and for configurations specific to Android projects.

### Maven

Add dependencies in the `pom.xml` configuration file:

```xml
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>dataframe</artifactId>
<version>1.0.0-Beta4</version>
</dependency>
```

Make sure that you have `mavenCentral` in the list of repositories:

```xml
<repositories>
<repository>
<id>mavenCentral</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
```

Refer to
[Get started with Kotlin DataFrame on Maven](https://kotlin.github.io/dataframe/setupmaven.html).

* See [the Maven project with the Kotlin DataFrame Compiler plugin](examples/kotlin-dataframe-plugin-gradle-example).


## Code example

This example of Kotlin DataFrame code with
the [Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) enabled.
See [the full project](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-example).
See [the full project](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-gradle-example).
See also
[this example in Kotlin Notebook](https://github.com/Kotlin/dataframe/tree/master/examples/notebooks/readme_example.ipynb).

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ tasks.assemble {
// subprojects use the Gradle version from the root project, so let's sync them to ensure standalone version will build as well.
doLast {
val source = file("gradle/wrapper/gradle-wrapper.properties")
listOf("examples/android-example", "examples/kotlin-dataframe-plugin-example").forEach { sub ->
listOf("examples/android-example", "examples/kotlin-dataframe-plugin-gradle-example").forEach { sub ->
val target = file("$sub/gradle/wrapper/gradle-wrapper.properties")
if (source.readText() != target.readText()) {
source.copyTo(target, overwrite = true)
Expand Down
1 change: 1 addition & 0 deletions docs/StardustDocs/d.tree
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<toc-element topic="Setup.md" accepts-web-file-names="gettingstarted">
<toc-element topic="SetupKotlinNotebook.md" accepts-web-file-names="gettingstartedkotlinnotebook.html"/>
<toc-element topic="SetupGradle.md" accepts-web-file-names="gettingstartedgradle.html"/>
<toc-element topic="SetupMaven.md"/>
<toc-element topic="SetupJupyter.md" accepts-web-file-names="gettingstartedjupyternotebook.html"/>
<toc-element topic="SetupDatalore.md" accepts-web-file-names="gettingstarteddatalore.html"/>
<toc-element topic="SetupAndroid.md"/>
Expand Down
13 changes: 7 additions & 6 deletions docs/StardustDocs/topics/Compiler-Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ Setup library dependency:
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
```

Add this line to `gradle.properties`:
Due to the [known issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
Add the following line to your `gradle.properties` file:

```properties
kotlin.incremental=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koperagen this isn't a problem in Maven?

Copy link
Collaborator

@koperagen koperagen Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem there

```

Sync the project.

Disabling incremental compilation will no longer be necessary
when https://youtrack.jetbrains.com/issue/KT-66735 is resolved.

</tab>

<tab title="Maven">
Expand Down Expand Up @@ -164,6 +163,8 @@ fun main() {

## Examples

* [Kotlin DataFrame in the IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
— an IntelliJ IDEA project showcasing simple DataFrame expressions using the Compiler Plugin.
* [Kotlin DataFrame in the IntelliJ IDEA Gradle project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
— an IntelliJ IDEA Gradle project showcasing simple DataFrame expressions using the Compiler Plugin.
* [Kotlin DataFrame in the IntelliJ IDEA Maven project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-maven-example)
— an IntelliJ IDEA Maven project showcasing simple DataFrame expressions using the Compiler Plugin.
* [](compilerPluginExamples.md) — few examples of Compiler Plugin usages.
3 changes: 2 additions & 1 deletion docs/StardustDocs/topics/compilerPluginExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
This page provides a few examples that you can copy directly to your project.
[Schema info](staticInterpretation.md#schema-info) will be a convenient way to observe the result of different operations.

> See also an [IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example),
> See also an
> [IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example),
> showcasing simple DataFrame expressions using the Compiler Plugin.

### Example 1
Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/extensionPropertiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ df.rename { name }.into("firstName")
.filter { firstName == "Nikita" }
```

See [Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-example)
See [Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-gradle-example)
IDEA project with basic Extension Properties API examples.
</tab>
</tabs>
Expand Down
9 changes: 7 additions & 2 deletions docs/StardustDocs/topics/guides/Guides-And-Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ and make working with your data both convenient and type-safe.

Explore our extensive collection of practical examples and real-world analytics workflows.

* [Kotlin DataFrame Compiler Plugin Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
— a simple project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
* [Kotlin DataFrame Compiler Plugin Gradle Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
— a simple Gradle project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
showcasing DataFrame expressions with [extension properties](extensionPropertiesApi.md)
that are generated on-the-fly in the IDEA project.

* [Kotlin DataFrame Compiler Plugin Maven Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
— a simple Maven project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
showcasing DataFrame expressions with [extension properties](extensionPropertiesApi.md)
that are generated on-the-fly in the IDEA project.

Expand Down
3 changes: 3 additions & 0 deletions docs/StardustDocs/topics/setup/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ for [data analysis](https://kotlinlang.org/docs/data-analysis-overview.html).
- [**Setup in Gradle**](SetupGradle.md) — add Kotlin DataFrame to your Gradle project for convenient data handling
in your Kotlin applications.

- [**Setup in Maven**](SetupMaven.md) — add Kotlin DataFrame to your Maven project for convenient data handling
in your Kotlin applications.

- [**Setup on Android**](SetupAndroid.md) — use Kotlin DataFrame in your Android apps to simplify local data processing
and transformation.

Expand Down
10 changes: 9 additions & 1 deletion docs/StardustDocs/topics/setup/SetupGradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,21 @@ plugins {
</tab>
</tabs>

Due to [this issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
Due to the [known issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
Add the following line to your `gradle.properties` file:

```properties
kotlin.incremental=false
```

## Project Example

See [the Gradle example project with the Kotlin DataFrame Compiler Plugin enabled on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-gradle-example).

You can also
[download this project](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip).


## Next Steps

* Once you’ve set up Kotlin DataFrame in your Gradle project, continue with the [](quickstart.md)
Expand Down
126 changes: 126 additions & 0 deletions docs/StardustDocs/topics/setup/SetupMaven.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Setup Kotlin DataFrame in Maven

<web-summary>
Set up Kotlin DataFrame in your Maven project, configure dependencies, and start using the API with full IDE support.
</web-summary>

<card-summary>
Learn how to add Kotlin DataFrame to your Maven project.
</card-summary>

<link-summary>
Guide for integrating Kotlin DataFrame in a Maven project, with setup instructions and example code.
</link-summary>

Kotlin DataFrame can be added as a usual Maven dependency to your Kotlin project.

## Create a Kotlin project

1. In IntelliJ IDEA, select **File** | **New** | **Project**.
2. In the panel on the left, select **New Project**.
3. Name the new project and change its location, if necessary.

> Select the **Create Git repository** checkbox to place the new project under version control.
> You can enable this later at any time.
> {type="tip"}
4. From the **Language** list, select **Kotlin**.
5. Select the **Maven** build system.
6. From the **JDK list**, select the [JDK](https://www.oracle.com/java/technologies/downloads/)
that you want to use in your project. The minimum supported version is JDK 8.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should recommend newer versions as well, as some parts of DF require 11

* If the JDK is installed on your computer, but not defined in the IDE, select **Add JDK**
and specify the path to the JDK home directory.
* If you don't have the necessary JDK on your computer, select **Download JDK**.
7. Select the **Add sample code** checkbox to create a file with a sample `"Hello World!"` application.
8. Click **Create**.

You have successfully created a project with Maven.

## Add Kotlin DataFrame Maven dependency

In your Maven build file (`pom.xml`), add the Kotlin DataFrame library as a dependency:

```xml
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>dataframe</artifactId>
<version>%dataFrameVersion%</version>
</dependency>
```

This will add [general Kotlin DataFrame dependency](Modules.md#dataframe-general),
i.e., [core API and implementation](Modules.md#dataframe-core) as well as all
[IO modules](Modules.md#io-modules) (excluding [experimental ones](Modules.md#experimental-modules)).
You can add only the [core API module](Modules.md#dataframe-core)
and the specific [modules](Modules.md) you need.


## Hello World

Let’s create your first [`DataFrame`](DataFrame.md) — a simple "Hello, World!" style example:

```kotlin
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
import org.jetbrains.kotlinx.dataframe.api.print

fun main() {
val df = dataFrameOf(
"name" to listOf("Alice", "Bob"),
"age" to listOf(25, 30)
)

df.print()
}
```

## Kotlin DataFrame Compiler Plugin

[Kotlin DataFrame Compiler Plugin](Compiler-Plugin.md) enables automatic generation of
[extension properties](extensionPropertiesApi.md) and updates [data schemas](schemas.md)
on-the-fly in Maven projects, making development with Kotlin DataFrame faster,
more convenient, and fully type- and name-safe.

> Requires Kotlin 2.2.20-Beta1 or higher and IntelliJ IDEA 2025.3 or higher.
> { style = "note" }
To enable the plugin in your Maven project, add it to the `plugins` section:

```xml
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>%compilerPluginKotlinVersion%</version>

<configuration>
<compilerPlugins>
<plugin>kotlin-dataframe</plugin>
</compilerPlugins>
</configuration>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-dataframe</artifactId>
<version>%compilerPluginKotlinVersion%</version>
</dependency>
</dependencies>
</plugin>
```

## Project Example

See [the Maven example project with the Kotlin DataFrame Compiler Plugin enabled on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-maven-example).

You can also
[download this project](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-maven-example.zip).


## Next Steps

* Once you’ve set up Kotlin DataFrame in your Maven project, continue with the [](quickstart.md)
to learn the basics of working with Kotlin DataFrame.
* Explore [detailed guides and real-world examples](Guides-And-Examples.md)
to see how Kotlin DataFrame helps with different data tasks.
* Check out various
[IDEA examples using Kotlin DataFrame on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/idea-examples).
* Learn more about the [compiler plugin](Compiler-Plugin.md).
2 changes: 1 addition & 1 deletion docs/StardustDocs/v.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
<vars>
<var name="dataFrameVersion" value="1.0.0-Beta4" type="string"/>
<var name="compilerPluginKotlinVersion" value="2.3.0-RC" type="string"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.3.0 is released

<var name="compilerPluginKotlinVersion" value="2.3.0-RC3" type="string"/>
</vars>
6 changes: 4 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Examples of Kotlin DataFrame

### Idea examples
* [plugin example](kotlin-dataframe-plugin-example) IDEA project with a
[Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) example.
* [Gradle plugin example](kotlin-dataframe-plugin-gradle-example) IDEA project with a
[Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) example.
* [Maven plugin example](kotlin-dataframe-plugin-maven-example) IDEA project with a
[Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) example.
* [android example](android-example) A minimal Android project showcasing integration with Kotlin DataFrame.
Also includes [Kotlin DataFrame Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html).
* [movies](idea-examples/movies) Using extension properties [Access API](https://kotlin.github.io/dataframe/apilevels.html) to perform a data cleaning task
Expand Down
12 changes: 0 additions & 12 deletions examples/kotlin-dataframe-plugin-example/README.md

This file was deleted.

Loading