Commit 80b4b320 authored by Tomas Gavenciak's avatar Tomas Gavenciak
Browse files

Add simple CBOR-stream debugging utility

parent bfa50b0b
#!/usr/bin/env python3
"""
A simple debug utility to print all the CBOR-encoded items from the
standard input. Does not handle compression -- if your data is
compressed, use e.g. as:
cat data.cbor.gz | gzip -d | ./dump_cbor_stream.py
"""
import sys
import cbor
while True:
try:
d = cbor.load(sys.stdin.buffer)
except EOFError:
break
try:
print(d)
except BrokenPipeError:
break
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment