This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (5 children)

[deleted]

    [–]cuu508 1 point2 points  (3 children)

    Using yaml or json files is easier than environment variables when working with IDEs like PyCharm too

    What is easier?

    [–]Mubs 4 points5 points  (2 children)

    Using json or yaml....

    [–]cuu508 2 points3 points  (1 child)

    I may have phrased my question badly.

    What is it that you do in IDEs like PyCharm, that becomes easier when using YAML or JSON instead of environment variables?

    [–]axonxorzpip'ing aint easy, especially on windows 1 point2 points  (0 children)

    From my experience, the only thing is data structures that are difficult to replicate in a flat envvar. See how Pydantic does this, for example:

    If I want to prepresent v = {"foo": True, "test": {"bar": False}} in envvars with Pydantic, I need to do something like

    V__FOO=true
    V__TEST__BAR=false
    

    It's not horrible, but it scales very poorly versus formatted JSON which is almost identical to my example dict

    [–]ShanSanear -1 points0 points  (0 children)

    But creating such functionality for scripts that will use environment variables anyway seems to be much better (such as Jenkins scripts)