dataclass icon indicating copy to clipboard operation
dataclass copied to clipboard

Feature: Rename fields

Open glensc opened this issue 1 year ago • 0 comments

Say I have input data:

{
  "name": "boo",
  "full name": "baz"
}

I would need to store "full name" in a valid property name, $fullName or $full_name, hence need. to do some name mapping.

python dataclases have some __post_init__:

  • https://docs.python.org/3/library/dataclasses.html#post-init-processing

maybe a similar static method could be called from the class if the magic method exists?

glensc avatar Mar 21 '23 13:03 glensc