eladrich / pyrallis

Pyrallis is a framework for structured configuration parsing from both cmd and files. Simply define your desired configuration structure as a dataclass and let pyrallis do the rest!
https://eladrich.github.io/pyrallis/
MIT License
201 stars 7 forks source link

Added pyrallis.set_config_type to support json and toml :wrench: #7

Closed eladrich closed 2 years ago

eladrich commented 2 years ago

Added an option to globally change the configuration format from yaml to json or toml. as suggested in #3

Why globally?

  1. To ensure that the syntax of all functions remain simple for users who just want to use yaml
  2. To make sure the functionality is consistent between all functions
eladrich commented 2 years ago

Still need to update the docs and review

eladrich commented 2 years ago

Improved typing mechanism, and added support for context

with pyrallis.config_type('json'):
    pyrallis.dump(...)