Skip to content
Discussion options

You must be logged in to vote

cbor2 1.6.4 is now supported on Android and iOS: https://pypi.flet.dev/cbor2

cbor2 gives you CBOR (RFC 8949) — a binary, schema-less serialization format with the same data model as JSON plus native bytes, big integers, decimals, and tagged types, in a fraction of the size. The API mirrors json: cbor2.dumps / cbor2.loads / dump / load.

Install

Just add it to your dependencies:

[project]
dependencies = [
  "flet",
  "cbor2==6.1.4",
]

Example

Encodes a record JSON can't represent (raw bytes, a 100-bit integer), decodes it back, and shows the size win on screen:

import json

import cbor2
import flet as ft


def main(page: ft.Page):
    page.title = "cbor2 demo"

    record = {
        "id": 7,…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ndonkoHenri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants