{"id":50690075,"url":"https://github.com/msgspec/msgspec","last_synced_at":"2026-06-11T17:00:49.280Z","repository":{"id":37029791,"uuid":"332952543","full_name":"msgspec/msgspec","owner":"msgspec","description":"A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML","archived":false,"fork":false,"pushed_at":"2026-06-10T16:47:07.000Z","size":15147,"stargazers_count":3796,"open_issues_count":211,"forks_count":149,"subscribers_count":27,"default_branch":"main","last_synced_at":"2026-06-10T17:15:09.003Z","etag":null,"topics":["deserialization","json","json-schema","jsonschema","messagepack","msgpack","openapi3","python","schema","serde","serialization","toml","validation","yaml"],"latest_commit_sha":null,"homepage":"https://msgspec.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msgspec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":"docs/supported-types.rst","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-26T02:53:57.000Z","updated_at":"2026-06-10T16:48:35.000Z","dependencies_parsed_at":"2023-10-11T19:57:27.358Z","dependency_job_id":"0cf708d3-39d3-49ed-8e6c-2b6827d6a4eb","html_url":"https://github.com/msgspec/msgspec","commit_stats":{"total_commits":746,"total_committers":28,"mean_commits":"26.642857142857142","dds":"0.036193029490616646","last_synced_commit":"595c33c4a71c6d0c539b82233982a65819e240cf"},"previous_names":["msgspec/msgspec"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/msgspec/msgspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgspec%2Fmsgspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgspec%2Fmsgspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgspec%2Fmsgspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgspec%2Fmsgspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msgspec","download_url":"https://codeload.github.com/msgspec/msgspec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgspec%2Fmsgspec/sbom","scorecard":{"id":511871,"data":{"date":"2025-08-11","repo":{"name":"github.com/jcrist/msgspec","commit":"bc60e96772c5e8a3babff967d86a9e7dfcdbfb1b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: .github/SECURITY.md:1","Info: Found linked content: .github/SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: .github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/docs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":3,"reason":"0 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 10/29 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:108: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:123: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:131: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:143: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:150: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/docs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/jcrist/msgspec/docs.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/docs.yml:21","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   6 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:136"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T00:45:25.973Z","repository_id":37029791,"created_at":"2025-08-20T00:45:25.973Z","updated_at":"2025-08-20T00:45:25.973Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34208761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deserialization","json","json-schema","jsonschema","messagepack","msgpack","openapi3","python","schema","serde","serialization","toml","validation","yaml"],"created_at":"2026-06-09T02:00:35.418Z","updated_at":"2026-06-11T17:00:49.274Z","avatar_url":"https://github.com/msgspec.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://msgspec.dev\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-dark.svg\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-light.svg\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-light.svg\" width=\"35%\" alt=\"msgspec\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![CI](https://github.com/msgspec/msgspec/actions/workflows/ci.yml/badge.svg)](https://github.com/msgspec/msgspec/actions/workflows/ci.yml)\n[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://msgspec.dev)\n[![License](https://img.shields.io/github/license/msgspec/msgspec.svg)](https://github.com/msgspec/msgspec/blob/main/LICENSE)\n[![PyPI Version](https://img.shields.io/pypi/v/msgspec.svg)](https://pypi.org/project/msgspec/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/msgspec.svg)](https://anaconda.org/conda-forge/msgspec)\n[![Code Coverage](https://codecov.io/gh/msgspec/msgspec/branch/main/graph/badge.svg)](https://app.codecov.io/gh/msgspec/msgspec)\n\n\u003c/div\u003e\n\n`msgspec` is a *fast* serialization and validation library, with builtin\nsupport for [JSON](https://json.org), [MessagePack](https://msgpack.org),\n[YAML](https://yaml.org), and [TOML](https://toml.io/en/). It features:\n\n- 🚀 **High performance encoders/decoders** for common protocols. The JSON and\n  MessagePack implementations regularly\n  [benchmark](https://msgspec.dev/benchmarks.html) as the fastest\n  options for Python.\n\n- 🎉 **Support for a wide variety of Python types**. Additional types may be\n  supported through\n  [extensions](https://msgspec.dev/extending.html).\n\n- 🔍 **Zero-cost schema validation** using familiar Python type annotations. In\n  [benchmarks](https://msgspec.dev/benchmarks.html) `msgspec`\n  decodes *and* validates JSON faster than\n  [orjson](https://github.com/ijl/orjson) can decode it alone.\n\n- ✨ **A speedy Struct type** for representing structured data. If you already\n  use [dataclasses](https://docs.python.org/3/library/dataclasses.html) or\n  [attrs](https://www.attrs.org/en/stable/),\n  [structs](https://msgspec.dev/structs.html) should feel familiar.\n  However, they're\n  [5-60x faster](https://msgspec.dev/benchmarks.html#structs)\n  for common operations.\n\nAll of this is included in a\n[lightweight library](https://msgspec.dev/benchmarks.html#library-size)\nwith no required dependencies.\n\n---\n\n`msgspec` may be used for serialization alone, as a faster JSON or\nMessagePack library. For the greatest benefit though, we recommend using\n`msgspec` to handle the full serialization \u0026 validation workflow:\n\n**Define** your message schemas using standard Python type annotations.\n\n```python\n\u003e\u003e\u003e import msgspec\n\n\u003e\u003e\u003e class User(msgspec.Struct):\n...     \"\"\"A new type describing a User\"\"\"\n...     name: str\n...     groups: set[str] = set()\n...     email: str | None = None\n```\n\n**Encode** messages as JSON, or one of the many other supported protocols.\n\n```python\n\u003e\u003e\u003e alice = User(\"alice\", groups={\"admin\", \"engineering\"})\n\n\u003e\u003e\u003e alice\nUser(name='alice', groups={\"admin\", \"engineering\"}, email=None)\n\n\u003e\u003e\u003e msg = msgspec.json.encode(alice)\n\n\u003e\u003e\u003e msg\nb'{\"name\":\"alice\",\"groups\":[\"admin\",\"engineering\"],\"email\":null}'\n```\n\n**Decode** messages back into Python objects, with optional schema validation.\n\n```python\n\u003e\u003e\u003e msgspec.json.decode(msg, type=User)\nUser(name='alice', groups={\"admin\", \"engineering\"}, email=None)\n\n\u003e\u003e\u003e msgspec.json.decode(b'{\"name\":\"bob\",\"groups\":[123]}', type=User)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nmsgspec.ValidationError: Expected `str`, got `int` - at `$.groups[0]`\n```\n\n`msgspec` is designed to be as performant as possible, while retaining some of\nthe nicities of validation libraries like\n[pydantic](https://pydantic.dev/docs/validation/latest/get-started/). For supported types,\nencoding/decoding a message with `msgspec` can be\n[~10-80x faster than alternative libraries](https://msgspec.dev/benchmarks.html).\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://msgspec.dev/benchmarks.html\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/bench-validation.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nSee [the documentation](https://msgspec.dev) for more information.\n\n\n## LICENSE\n\nNew BSD. See the\n[License File](https://github.com/msgspec/msgspec/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgspec%2Fmsgspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsgspec%2Fmsgspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgspec%2Fmsgspec/lists"}