Questions tagged [pyyaml]

PyYAML is a YAML 1.1 parser and emitter for Python. Use this tag for PyYAML specific python questions.

PyYAML is a parser/dumper for YAML 1.1 for the Python programming language.

PyYAML does not yet implemented the feature changes from the YAML 1.2 specification released in 2009.

See http://pyyaml.org/wiki/PyYAML for background and documentation.

Source code: https://github.com/yaml/pyyaml

828 questions
-1
votes
1 answer

Installation of OpenStack fail on Fedora because of PyYAML

I am doing a presentation on Openstack for a training course. I would like to install a light version of Openstack to test the tool and understand how it works. I tried to install Packstack on Fedora. I followed instructions from a book and…
Yvanou
  • 93
  • 1
  • 3
  • 7
-1
votes
1 answer

How to remove single quotes from string inside curly braces? (python, yaml)

I'm using pyyaml. And writing code that will convert user information into yaml file of certain style. And I have certain requirements. Like some strings should have single qoutation, some double quotation and the rest should have no quotation mark…
Unknown _
  • 17
  • 3
-1
votes
1 answer

Syntax of multiple dictionaries in one YAML file and how to access each one of them with PyYAML

I have a few small dictionaries which I would like to include in one yaml file and access each one of them separately with PyYAML. After having some trouble finding out how to write the YAML file, I ended up with this version, where --- is supposed…
Newbielp
  • 431
  • 3
  • 16
-1
votes
1 answer

pyyaml dump and yamllint document start

I am using yaml.dump to write out my yaml files from aggregated data. This yaml file is then fed to a 3rd party tool that uses yamllint to check the file before processing the data. I have two problems. The first I've found an amazing solution that…
JDWK
  • 51
  • 5
-1
votes
1 answer

Parsing yaml list and dicts in Python

Using Python3 and pyyaml how can I accomplish the following? Yaml: role-templates: - readonly: - step1; - step2; - readwrite: - step1; - step2 - step3; Given a role (readonly or readwrite), I need a list of steps. This doesn't work…
rboarman
  • 8,248
  • 8
  • 57
  • 87
-1
votes
1 answer

Bigquery api using python Api

I am trying to automate the tables creation in BQ by reading bucket raw files(based on the bucket file name it should creat same tables )which will use yml as a configuration. Can anyone provide a lead on this as how to write with sone code sample.
SKP
  • 1
  • 3
-1
votes
1 answer

Pyyaml file installation on Python 3.9.2 (64bit)

i am trying to install pyYAML on python 3.9.2 (64bit), but not able to find the right link from where i can download the same. please help...
-1
votes
1 answer

Dump nested list with pyyaml fails

I am trying to save a nested list with yaml. The list is created from a numpy object array. However, it does only save the first entry of the list correctly. For the second entry it raises a numpy error, even though the type is a list. Any ideas…
Tamme
  • 23
  • 4
-1
votes
2 answers

CORS error when using pyyaml with FastAPI

I am trying to create a simple web-application using a react front end and fastapi back end. One function of the web-app is the send a file that is collected at the front end and processed on the back end. I have an endpoint on the back end that…
Brian L
  • 549
  • 7
  • 21
-1
votes
3 answers

Stop PyYaml from converting a yaml item to list

I am trying to load the following yaml: yaml_string = """ key: - [HELLO] - another string - another """ yaml.safe_load(yaml_string) # returns {"key": [["HELLLO"], "another_string", "another"} and the result is a list containing the HELLO string. I…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
-1
votes
1 answer

Is this a valid YAML file?

Consider the following file: - k0: v0 vars: &splat0 VAR0: potato # vars from blob0 - k1: v1 vars: &splat1 VAR1: spud # vars from blob1 - k: v extra: # merged vars from blob0 + blob1 <<: *splat0 <<: *splat1 It…
wim
  • 338,267
  • 99
  • 616
  • 750
-1
votes
1 answer

Conda environment wrong pyyaml version

conda list pyyaml # packages in environment at c:\Anaconda3: # # Name Version Build Channel pyyaml 3.13 py36hfa6e2cd_1001 conda-forge conda env list # conda environments: # …
vbd
  • 3,437
  • 4
  • 32
  • 45
-1
votes
1 answer

Python3 - YAML not correctly appending values in list

Snippet of the .yml file: - hosts: arbiters roles: - role: roles/arbiters vars: machines: arb-1: - repset: r-11 mongoversion: 4.2 port: 27017 - repset: r-17 …
Kevin C
  • 4,851
  • 8
  • 30
  • 64
-1
votes
2 answers

OrderedDict of OrderedDict and storing data in YAML Issues

So basically I have an app I'm making that has user data which I want to backup and load in the database. I'm storing the data in yml files. Now, a user has posts. Each post has a timestamp, text and tags. I want to use an ordereddictionary in order…
Hamza
  • 61
  • 7
-1
votes
1 answer

How to write a yaml in python for multiple test cases?

I am learning Robot framework using python. I am looking for ways to pass data to two different test cases. In java, this was easy. I made a class for yaml and gave the data for two separate test cases in the yaml file. How can I have such an…
aswathy
  • 139
  • 2
  • 16