Skip to content

DaemonicLabs/KNote

Repository files navigation

Build Status
maven-badge

KNote

Setup Instructions

Before opening the Project in Intellij Idea run ./gradlew publishToMavenLocal to save yourself a restart later

For Unix (linux / osx)

  1. Select the default gradle wrapper distribution.

alttext

  1. You will also need to import sample/build.script.kts

alttext alttext

  1. Yours might look red and angry and missing your Run Configurations. Open the gradle sidebar for sample-notebook > tasks > application. When that's done running, you may need to restart your IDEA, as it's necessary for any large change in script definitions.

alttext

Docs

Notebook

notebooks files have to match notebooks/*.notebook.kts

in a .notebook.kts you can set the title and description of a notebook

and register type adapters for visualization (WIP)

TODO: add defaultImports
TODO: add result adapter

Page

page files have to match ${notebookId}_pages/*.page.kts

Pages can also have customizable titles and descriptions (WIP) as well as process data

example using krangle

import krangl.DataFrame
import krangl.readCSV

fun process(): DataFrame {
    val csvFile = rootDir.resolve("data").resolve("msleep.csv")
    val sleepData = DataFrame.readCSV(csvFile)
    return sleepData
}

NOTE: possibly process function will be replaced by val result get() = ...

Pages can also use the results from other pages (in the same notebook)

@file:FromPage("sleepData")
import krangl.*

fun process(): DataFrame = sleepData.filter { it["sleep_total"] gt 16}

Releases

No releases published

Packages

No packages published

Languages