python-scala-data-structures-mapping

Guidelines for translating Python dataclasses, enums, and collections to Scala.

cxcscmu/skilllearnbench1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI

Agent Skills format with YAML frontmatter. Claude Code reads it as-is.

---
name: "python-scala-data-structures-mapping"
description: "Guidelines for translating Python dataclasses, enums, and collections to Scala."
license: "MIT"
---

# Python to Scala Data Structures

## Dataclasses to Case Classes
- Python `@dataclass(frozen=True)` -> Scala `case class`.
- Python `field(default_factory=dict)` -> Scala default argument `metadata: Map[String, Any] = Map.empty`.

## Enums
- Python `Enum` -> Scala `sealed trait` with `case object`s or `Enumeration`.
- For string values, a `sealed trait` with a `value` property is idiomatic.

## Collections
- Python `list` -> Scala `List` or `Vector`.
- Python `dict` -> Scala `Map`.
- Python `tuple` -> Scala `Tuple` or `Vector` (if variable length).
- Python `Sequence` -> Scala `Seq`.
- Python `Iterable` -> Scala `Iterable`.
- Python `Iterator` -> Scala `Iterator`.

More General & Other skills

← All General & Other skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY