-
Notifications
You must be signed in to change notification settings - Fork 107
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
Option to autoconvert camelCase to snake_case #66
Comments
Not only that, it would be awesome to support removing trailing spaces from keys (e.g. my key is called |
Hi @kiddick - thank you very much for reporting issue. Unfortunately, I don't think it's a good idea to add any "data" processing features into I'm pretty sure that there are plenty of "camelCase-to-snake_case" libs in PyPI. You just have to call such lib before passing data to |
@konradhalas -- thanks so much for this library! I am trying to use it to convert a large structure loaded from yaml. As you note, converting individual strings is not a problem. However, walking the data structure and recursively converting them before passing the structure to dacite seems like duplicate work. Perhaps you could consider a |
FYI, I forked dacite and added a convert_key callable to the Config. Seems to work pretty fine. |
Hi! Thanks for the work! 🚀 Would you be interested in making a PR back to the repo? |
|
Is it possible to add such option to Config?
I have some 3rd party json with keys in
camelCase
but that isn't appropriate naming for attributes in dataclassThe text was updated successfully, but these errors were encountered: