vangorra / python_withings_api

Library for the Withings Health API
MIT License
101 stars 34 forks source link

consider change to pydantic #47

Closed wasdee closed 3 years ago

wasdee commented 3 years ago

I saw a lot of attempts to do validation. I saw your love in arrow lib. really good taste pydantic might be a good fit to this project. I can help you migrate.

https://github.com/vangorra/python_withings_api/blob/1c1f36d4fb036acd2e4c8337da46dd4a85d75092/withings_api/common.py#L751-L763

wasdee commented 3 years ago

I thought you are not agree. So, I've been working on my https://github.com/codustry/python_withings_api/tree/codustry_s for a while.

Nice to see ur PR and look forward to contribute to your repo.

vangorra commented 3 years ago

I'm always happy to remove code to reduce maintenance. I want sure pydandic would work but once I realized it has no dependencies, is type strict and allows for immutable objects, I figured it was worth an attempt. There was a bit of a learning curve but this worked out nicely.