Run2 scala circe json
Using circe for JSON tokenization in Scala, including printing, cursor navigation, and path-based access.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run2_scala-circe-jsonAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.9 KB, 194 tokens by cl100k_base, as published. Nobody here has run it
Circe JSON for Tokenization
Printing
import io.circe.{Json, Printer}
val compact = Printer.noSpaces.print(json)
val pretty = Printer.spaces2.print(json)
Path-Based Navigation with ACursor
import io.circe.ACursor
def navigate(json: Json, path: String): Option[Json] = {
val cursor = path.split("\\.").foldLeft(json.hcursor: ACursor) { (c, part) =>
if (part.forall(_.isDigit)) c.downN(part.toInt)
else c.downField(part)
}
cursor.focus
}
Key Differences from Python json module
- circe uses
JsonADT instead of Python's dynamic types - No need for recursive
JsonValuetype alias -Jsonis already recursive - Printing via
Printerinstances rather thanjson.dumpskwargs
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.