Skip to content
Advertisement

Tag: yaml

Pyyaml dump does not produce anchors for the same objects

I was experimenting a bit with PyYaml and I wanted to have a reference to a value appearing previously in the yaml. To give an example: from what I understood from the specifications pyyaml should be adding an anchor to each object that has already been encountered. In my case, I would expect to have in the yaml file: as

Way to delete yaml keys in the form “a.b.c.e”?

I have yaml keys in the form “a.b.c.d” but my yaml file is in the format: I want to delete “a.b.c.e” here and I have around 300 rows of yaml keys in similar format any idea on how to delete the keys? I know about the del function in ruamel.yaml if it will be possible integrate. Like Lets say I

Using dynamic object name in YAML scheme

I want to validate YAML files in Python with my own scheme. A valid YAML shall look like this: While [windows, other] are dynamic, any name shall allowed there (i.e. “solaris”, “mac”, “templeOS”) I’m using validate from jsonschema like described here: Validating a yaml document in python Any other module where this works would be also okay. Answer You’re searching

Difference of Double Quotes and Vertical bar in yaml

I’m writing a Python script that creates a YAML file according to DataFrame and I came across this: vs Are they technically the same or am I missing something? If they are not the same, how do I make the second version like the first that uses a vertical bar. Answer They are technically not the same, but they are

Check value of yaml child -Python

Hey guys I have two yaml files. One yaml with jobs and ther information as childs. other yaml (yaml2) with requirements: and I want to check if the value of the Child “stage” is the same as in the requirements in my code the father node must be generic so it can be different jobs. But it can have the

Advertisement