nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
27.02k stars 1.54k forks source link

Use Pydantic as Data Validator / Storage #2182

Open nicolargo opened 2 years ago

nicolargo commented 2 years ago

See: https://pydantic-docs.helpmanual.io/usage/models/ also have a look on: https://github.com/jcrist/msgspec

Need Python 3.7 or higher.

Use it in https://github.com/nicolargo/glances/issues/2183 ?

RazCrimson commented 1 year ago

@nicolargo

About using Pydantic, are we going to use it for all the stats and outputs of the all the plugins or just with FastAPI?

I am not sure how much of a performance overhead the runtime validation performed by pydantic would result in. We also have the option of using dataclasses or NamedTuples with proper typing to identify static typing errors.

What do you think?

nicolargo commented 1 year ago

I think that the real value added is on the interface (REST). So for a first action, we will focus on the FastAPI data model.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 3 months with no activity.