Skip to content

Use pydantic classes for json serialization #78

@henrikingo

Description

@henrikingo

The Series and AnalyzedSeries classes support serializing themselves into json, via series.as_json() calls. This is not pythonic at all. (

def to_json(self, rounded=True):
)

It seems the modern best practice is to use Pydantic classes, which are like @dataclasses but better. In particular, a pydantic object can just be cast to dict(obj) or alternatively to json. https://docs.pydantic.dev/latest/concepts/serialization/

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions