Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from ruamel.yaml import YAML
- yaml = YAML(typ='safe')
- docs = yaml.load_all(sys.stdin)
- ABI_id = 42 # hard coded as I don't have your DB
- csv = []
- try:
- for doc_nr, doc in enumerate(docs, start=1):
- csv.append(f"{ABI_id}\t{doc['origin']}\t{doc['name']}\t{doc['version']}")
- except Exception as ex:
- print(f"Exception while parsing document number: {doc_nr}", ex)
- print("\n".join(csv))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement