summaryrefslogtreecommitdiff
path: root/support/testing/tests/package/sample_python_cbor_enc.py
blob: 1bde92bb9f0e7952247d349fd8a0ce596b88c693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import cbor

data = {
    "name": "python-cbor",
    "versions": ["1", "2"],
    "group": {
        "is_a_package": True,
        "value": 42
    }
}
serialized = cbor.dumps(data)
print(serialized)
with open("/tmp/data.cbor", "wb") as f:
    f.write(serialized)