You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
My use case involves
Writing configuration files by hand specifying the values of various Parameters in some easy-to-read format.
Deserializing the values stored in those files into a set of Parameterized instances.
Currently, the only file type that can be (de)serialized by param is JSON. It works, but is not very readable. It also does not support comments. It would be nice if param supported alternatives to JSON. If given the choice, I almost never pick JSON.
Describe the solution you'd like
Additional Serialization subclasses in serialization.py.
In particular, TOML is a dictionary-like structure similar to JSON. The library toml that has loads and dumps (de)serialization that functions similarly to JSON. I believe it wouldn't be particularly complicated.
YAML is another common type with (de)serialization between file and dictionary. It's a bit more complicated than TOML since the go-to library, PyYAML, is limited to YAML 1.1. There's a better library called ruamel.yaml that supports YAML 1.2. However, it hasn't hit a major version yet.
Describe alternatives you've considered
I've handled INI, JSON, and YAML (de)serialization in my personal repository.
Additional context
This request follows my discussion with @jbednar and @jlstevens. In addition to #482, I plan on writing two more feature requests: one for populating parameterized instances with deserialized dictionaries and another for integration with argparse.
I am happy to write the PR for this feature request, but wanted confirmation that this was indeed desirable functionality from the devs.
Thanks for your time,
Sean
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
My use case involves
Currently, the only file type that can be (de)serialized by param is JSON. It works, but is not very readable. It also does not support comments. It would be nice if param supported alternatives to JSON. If given the choice, I almost never pick JSON.
Describe the solution you'd like
Additional
Serialization
subclasses inserialization.py
.In particular, TOML is a dictionary-like structure similar to JSON. The library
toml
that hasloads
anddumps
(de)serialization that functions similarly to JSON. I believe it wouldn't be particularly complicated.YAML is another common type with (de)serialization between file and dictionary. It's a bit more complicated than TOML since the go-to library, PyYAML, is limited to YAML 1.1. There's a better library called ruamel.yaml that supports YAML 1.2. However, it hasn't hit a major version yet.
Describe alternatives you've considered
I've handled INI, JSON, and YAML (de)serialization in my personal repository.
Additional context
This request follows my discussion with @jbednar and @jlstevens. In addition to #482, I plan on writing two more feature requests: one for populating parameterized instances with deserialized dictionaries and another for integration with
argparse
.I am happy to write the PR for this feature request, but wanted confirmation that this was indeed desirable functionality from the devs.
Thanks for your time,
Sean
The text was updated successfully, but these errors were encountered: