desert icon indicating copy to clipboard operation
desert copied to clipboard

Capnproto support

Open python-desert opened this issue 5 years ago • 0 comments

Capnproto has a Python implementation.

Capnproto defines a language for defining a schema. For example,

@0xdbb9ad1f14bf0b36;  # unique file ID, generated by `capnp id`

struct Person {
  name @0 :Text;
  birthdate @3 :Date;

  email @1 :Text;
  phones @2 :List(PhoneNumber);

  struct PhoneNumber {
    number @0 :Text;
    type @1 :Type;

    enum Type {
      mobile @0;
      home @1;
      work @2;
    }
  }
}

struct Date {
  year @0 :Int16;
  month @1 :UInt8;
  day @2 :UInt8;
}

We might consider adding generation of Capnproto schemas as an alternative to json.

It's possible this would be better suited for a separate library that takes Marshmallow schemas into Capnproto schemas.

python-desert avatar Feb 04 '20 19:02 python-desert