Meta tags:
Headings (most frequently used words):
msgspec, highlights, used, by,
Text of the page (most frequently used words):
#msgspec (25), for (11), json (10), the (9), with (8), and (8), python (8), type (8), user (8), types (7), groups (7), alice (7), validation (5), name (5), used (4), other (4), libraries (4), serialization (4), library (4), messagepack (4), supported (4), faster (4), str (4), decode (4), admin (4), engineering (4), email (4), none (4), schema (4), light (4), dark (4), mode (4), this (3), support (3), can (3), through (3), annotations (3), messages (3), benchmarks (3), msg (3), using (3), porting (3), highlights (2), page (2), why (2), zero (2), many (2), encoders (2), decoders (2), are (2), providing (2), required (2), dependencies (2), lightweight (2), additional (2), also (2), extensions (2), wide (2), builtin (2), use (2), like (2), fastest (2), all (2), fast (2), message (2), than (2), back (2), encode (2), protocols (2), set (2), struct (2), may (2), alone (2), familiar (2), common (2), structs (2), orjson (2), performance (2), toml (2), auto (2), made, furo, pradyunsg, sphinx, copyright, jim, crist, harif, next, meltano, django, modern, rest, faststream, ravyn, anywidget, pioreactor, mosec, sanic, litestar, nautilustrader, organizations, here, highlight, few, open, source, projects, implemented, strictly, compliant, their, respective, specifications, stronger, guarantees, compatibility, systems, correct, has, binary, size, fraction, that, comparable, natively, supports, added, range, flexible, during, deserialization, declarative, way, works, well, checking, tooling, excellent, editor, integration, pyright, mypy, validated, friendly, outperforming, compared, designed, performant, possible, while, retaining, some, nicities, encoding, decoding, 80x, alternative, pydantic, file, line, expected, got, int, validationerror, module, stdin, traceback, most, recent, call, last, bob, 123, into, objects, optional, null, one, new, describing, class, import, your, schemas, standard, define, greatest, benefit, though, recommend, handle, full, workflow, included, representing, structured, data, you, already, should, feel, however, they, operations, 60x, attrs, dataclasses, speedy, decodes, validates, cost, variety, implementations, regularly, options, benchmark, high, features, yaml, view, top, changelog, parsing, pyproject, conda, repodata, asyncio, tcp, key, value, server, geojson, examples, api, docs, reference, from, guides, tips, inspecting, extending, advanced, evolution, converters, constraints, usage, guide, installation, overview, skip, content, expand, menu, contents,
Text of the page (random words):
msgspec contents menu expand light mode dark mode auto light dark in light mode auto light dark in dark mode skip to content msgspec overview why msgspec installation benchmarks user guide usage supported types structs constraints converters json schema schema evolution advanced extending inspecting types performance tips porting porting guides porting from orjson reference api docs examples geojson asyncio tcp key value server conda repodata parsing pyproject toml changelog back to top view this page msgspec msgspec is a fast serialization and validation library with builtin support for json messagepack yaml and toml it features high performance encoders decoders for common protocols the json and messagepack implementations regularly benchmark as the fastest options for python support for a wide variety of python types additional types may be supported through extensions zero cost schema validation using familiar python type annotations in benchmarks msgspec decodes and validates json faster than orjson can decode it alone a speedy struct type for representing structured data if you already use dataclasses or attrs structs should feel familiar however they re 5 60x faster for common operations all of this is included in a lightweight library with no required dependencies msgspec may be used for serialization alone as a faster json or messagepack library for the greatest benefit though we recommend using msgspec to handle the full serialization validation workflow define your message schemas using standard python type annotations import msgspec class user msgspec struct a new type describing a user name str groups set str set email str none none encode messages as json or one of the many other supported protocols alice user alice groups admin engineering alice user name alice groups admin engineering email none msg msgspec json encode alice msg b name alice groups admin engineering email null decode messages back into python objects with optional schema validation msgspec json decode msg type user user name alice groups admin engineering email none msgspec json decode b name bob groups 123 type user traceback most recent call last file stdin line 1 in module msgspec validationerror expected str got int at groups 0 msgspec is designed to be as performant as possible while retaining some of the nicities of validation libraries like pydantic for supported types encoding decoding a message with msgspec can be 10 80x faster than alternative libraries highlights msgspec is fast it benchmarks as the fastest serialization library for python outperforming all other json messagepack libraries compared msgspec is friendly through use of python s type annotations messages are validated during deserialization in a declarative way msgspec also works well with other type checking tooling like mypy and pyright providing excellent editor integration msgspec is flexible it natively supports a wide range of python builtin types support for additional types can also be added through extensions msgspec is lightweight it has no required dependencies and the binary size is a fraction of that of comparable libraries msgspec is correct the encoders decoders implemented are strictly compliant with their respective specifications providing stronger guarantees of compatibility with other systems used by msgspec is used by many organizations and open source projects here we highlight a few nautilustrader litestar sanic mosec pioreactor zero anywidget ravyn faststream django modern rest meltano next why msgspec copyright jim crist harif made with sphinx and pradyunsg s furo on this page msgspec highlights used by
|