Skip to content

Allow custom Parsers #962

Description

@Jolanrensen

Allowing users to set custom parsers would be very helpful. It could allow them things like:

class User(val name: String, val age: Int) {
    override fun toString() = "user-$name-$age"
}

DataFrame.parser.addCustomParser<User> {
    if (it.startsWith("user")) {
        val (_, name, age) = it.split("-")
        User(name, age)
    } else null
}

DataFrame.readCsv(myCustomUserData)

or we could even add an enum-specific variant. This can only be done with convert at the moment. It could allow immediate parsing of CSV -> enum for instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfilesreading/writing from/to files

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions