{"id":40192150,"url":"https://github.com/giannitedesco/xpdt","last_synced_at":"2026-01-19T19:34:13.246Z","repository":{"id":57477942,"uuid":"369959371","full_name":"giannitedesco/xpdt","owner":"giannitedesco","description":"eXPeditious Data Transfer","archived":false,"fork":false,"pushed_at":"2025-10-27T15:31:21.000Z","size":92,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-29T01:25:54.942Z","etag":null,"topics":["c","compilers","marshalling","protocol-buffers","python","serialization","xpdt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giannitedesco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/c/xfilemap.c","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-23T04:22:49.000Z","updated_at":"2025-10-27T15:31:25.000Z","dependencies_parsed_at":"2025-08-17T00:11:43.232Z","dependency_job_id":"5708ec66-59f8-436c-980e-698d07fae621","html_url":"https://github.com/giannitedesco/xpdt","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/giannitedesco/xpdt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giannitedesco%2Fxpdt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giannitedesco%2Fxpdt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giannitedesco%2Fxpdt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giannitedesco%2Fxpdt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giannitedesco","download_url":"https://codeload.github.com/giannitedesco/xpdt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giannitedesco%2Fxpdt/sbom","scorecard":{"id":208452,"data":{"date":"2025-08-11","repo":{"name":"github.com/giannitedesco/xpdt","commit":"61c95fd5c250f68b3ba9faa5a90be193b2b24fe8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE.txt: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":"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"}}]},"last_synced_at":"2025-08-17T00:16:27.359Z","repository_id":57477942,"created_at":"2025-08-17T00:16:27.359Z","updated_at":"2025-08-17T00:16:27.359Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28581683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T19:06:42.549Z","status":"ssl_error","status_checked_at":"2026-01-19T19:06:42.040Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c","compilers","marshalling","protocol-buffers","python","serialization","xpdt"],"created_at":"2026-01-19T19:34:13.189Z","updated_at":"2026-01-19T19:34:13.239Z","avatar_url":"https://github.com/giannitedesco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xpdt: eXPeditious Data Transfer\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/v/xpdt?label=pypi\" alt=\"PyPI version\"\u003e\n\u003c/div\u003e\n\n## About\nxpdt is (yet another) language for defining data-types and generating code for\nserializing and deserializing them. It aims to produce code with little or no\noverhead, especially in the case where some fields aren't required, and is\nbased on fixed-length representations allowing for branch-free zero-copy\ndeserialization and (at-most-)one-copy writes (source to buffer).\n\nThe generated C code, in particular, is highly optimized and often permits the\nelimination of data-copying for writes and enables optimizations such as\nloop-unrolling when deserializing fixed-length objects. This can lead to read\nspeeds in excess of 500 million objects per second (~1.8 nsec per object).\n\n## Examples\nThe xpdt source language looks similar to C struct definitions:\n\n```\nstruct timestamp {\n\tu32\ttv_sec;\n\tu32\ttv_nsec;\n};\n\nstruct point {\n\ti32\tx;\n\ti32\ty;\n\ti32\tz;\n};\n\nstruct line {\n\ttimestamp\ttime;\n\tpoint\t\tline_start;\n\tpoint\t\tline_end;\n\tbytes\t\tcomment;\n};\n```\n\nFixed width integer types from 8 to 128 bit are supported, along with the\n`bytes` type, which is a variable-length sequence of bytes.\n\n## Target Languages\nThe following target languages are currently supported:\n- C\n- Python\n\nThe C code is very highly optimized.\n\nThe Python code is about as well optimized for CPython as I can make it. It\nuses typed `NamedTuple` for objects, which has some small overhead over regular\ntuples, and it uses `struct.Struct` to do the packing/unpacking. I have also\ncode-golfed the generated bytecodes down to what I think is minimal given the\ndesign constraints. As a result, performance of the pure Python code is\ncomparable to a JSON library implemented in C or Rust.\n\nFor better performance in Python, it may be desirable to develop a Cython\ntarget. In some instances CFFI structs may be more performant since they can\navoid the creation/destruction of an object for each record.\n\nTarget languages are implemented purely as `jinja2` templates.\n\n## Serialization format\nThe serialization format for fixed-length objects is simply a packed C struct,\nwith little-endian fields.\n\nFor any object which contains variable length fields (eg. `bytes` or `utf8`):\n- a 32bit unsigned record length is prepended to the struct, this allows\n  efficient skipping of the whole record\n- all variable-length fields are converted to `u32` and contain the length, in bytes, of the data\n- all variable-length contents are appended after the struct in the order in\n  which they appear\n\nFor example, following the example above, the serialization would be:\n\n```\nu32 tot_len # = 41\nu32 time.tv_sec\nu32 time.tv_usec\ni32 line_start.x\ni32 line_start.y\ni32 line_start.z\ni32 line_end.x\ni32 line_end.y\ni32 line_end.z\nu32 comment # = 5\nu8 'H'\nu8 'e'\nu8 'l'\nu8 'l'\nu8 'o'\n```\n\n### Why Variable-Length Data at the End?\n\nPlacing variable-length fields at the end of the struct provides significant\nperformance benefits:\n\n1. xpdt is optimized for fast zero-copy deserialization, it especially tries to\n   avoid adding overhead in the case where only a subset of fields are\n   required. If variable length fields could come in the middle of a struct,\n   reading the length and skipping the field would incur a cost even when the\n   field is being skipped.\n2. Potentially large strings and payloads isolated: Only when the\n   variable-length field is needed do you pay the cost of calculating their\n   offsets. This is ideal for descriptive strings or optional metadata that is\n   rarely accessed.\n\n## Features\nThe feature-set is, as of now, pretty slim.\n\nThere are no array / sequence / map types, and no keyed unions.\n\nSupport for such things may be added in future provided that suitable\nimplementations exist. An implementation is suitable if:\n- It admits a zero (or close to zero) overhead implementation\n- it causes no overhead when the feature isn't being used\n\n# License\nThe compiler is released under the GPLv3.\n\nThe C support code/headers are released under the MIT license.\n\nThe generated code is yours.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiannitedesco%2Fxpdt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiannitedesco%2Fxpdt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiannitedesco%2Fxpdt/lists"}