Scala circe json
How to use circe for JSON processing in Scala. Use this skill whenever translating Python json operations to Scala or working with circe libraries.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill 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, 174 tokens by cl100k_base, as published. Nobody here has run it
Scala Circe JSON
When translating Python's json module to Scala, use io.circe when requested or working with Json data structures.
Parsing JSON
- Parse JSON string:
io.circe.parser.parse(string)returnsEither[ParsingFailure, Json]. - Extract value safely:
parse(string).getOrElse(Json.Null).
Generating JSON Strings
- Compact string output:
json.noSpaces. - Pretty printed output (indented):
json.spaces2.
Navigating JSON
- Objects:
json.asObjectreturnsOption[JsonObject]. - Arrays:
json.asArrayreturnsOption[Vector[Json]]. - Access object properties:
jsonObject(key)orjsonObject.toMap.get(key). - Access array elements:
jsonArray.lift(index).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.