Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pydantic as Data Validator / Storage #2182

Open
nicolargo opened this issue Nov 5, 2022 · 3 comments
Open

Use Pydantic as Data Validator / Storage #2182

nicolargo opened this issue Nov 5, 2022 · 3 comments
Labels
dependencies Pull requests that update a dependency file enhancement inactive
Milestone

Comments

@nicolargo
Copy link
Owner

nicolargo commented Nov 5, 2022

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 #2183 ?

@nicolargo nicolargo added this to the Glances 4.0.0 milestone Nov 5, 2022
@nicolargo nicolargo added enhancement dependencies Pull requests that update a dependency file labels Nov 5, 2022
@RazCrimson
Copy link
Collaborator

@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
Copy link
Owner Author

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.

@nicolargo nicolargo changed the title Use Pydantic as data validator / storage Use Pydantic as Data Validator / Storage Apr 8, 2024
@nicolargo nicolargo modified the milestones: Glances 4.0.0, Next releases Apr 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement inactive
Projects
None yet
Development

No branches or pull requests

2 participants