{"id":46140599,"url":"https://github.com/deftio/triepack","last_synced_at":"2026-03-07T03:04:04.242Z","repository":{"id":341114679,"uuid":"1167974891","full_name":"deftio/triepack","owner":"deftio","description":"Embedded compression library","archived":false,"fork":false,"pushed_at":"2026-03-02T07:54:14.000Z","size":305,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T08:51:31.337Z","etag":null,"topics":["datacompression","embedded-c","embedded-systems","json","json-compression","trie","trie-data-structure","triepack"],"latest_commit_sha":null,"homepage":"https://deftio.github.io/triepack/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deftio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"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":"2026-02-26T22:11:16.000Z","updated_at":"2026-03-02T07:54:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deftio/triepack","commit_stats":null,"previous_names":["deftio/triepack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deftio/triepack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Ftriepack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Ftriepack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Ftriepack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Ftriepack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deftio","download_url":"https://codeload.github.com/deftio/triepack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Ftriepack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"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":["datacompression","embedded-c","embedded-systems","json","json-compression","trie","trie-data-structure","triepack"],"created_at":"2026-03-02T06:06:23.862Z","updated_at":"2026-03-07T03:04:04.233Z","avatar_url":"https://github.com/deftio.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# triepack v1.1.0\n\n[![CI Build \u0026 Test](https://github.com/deftio/triepack/actions/workflows/ci.yml/badge.svg)](https://github.com/deftio/triepack/actions/workflows/ci.yml)\n[![C Coverage](https://img.shields.io/endpoint?url=https://deftio.github.io/triepack/coverage-badge.json)](https://deftio.github.io/triepack/coverage/)\n[![License: BSD-2-Clause](https://img.shields.io/badge/License-BSD_2--Clause-blue.svg)](LICENSE.txt)\n\nA compressed trie-based dictionary format for fast, compact key-value storage.\n\nTriePack encodes dictionaries into a compact binary format (`.trp`) optimized for fast lookups, prefix search, and ROM-safe deployment. It uses prefix sharing and bit-level packing with configurable symbol encoding and full value type support.\n\n## Features\n\n- **Compact binary format** — compressed tries with suffix sharing\n- **Fast lookups** — O(key-length) point queries\n- **Prefix search** — iterate all keys matching a prefix\n- **Fuzzy search** — find keys within edit distance d\u003c=2\n- **ROM-safe** — readers work directly on `const` buffers with zero allocation\n- **Typed values** — null, bool, int, uint, float, double, string, blob, array, nested dict\n- **JSON support** — encode/decode JSON documents to/from `.trp` format\n- **C99 core** — portable C library with C++11 wrappers\n- **32-bit and 64-bit** — works on both architectures\n\n## Quick Start\n\n```bash\n# Build\ncmake -B build -DBUILD_TESTS=ON\ncmake --build build\n\n# Run tests\nctest --test-dir build --output-on-failure\n```\n\n### C API\n\n```c\n#include \"triepack/triepack.h\"\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\n/* Encode */\ntp_encoder *enc = NULL;\ntp_encoder_create(\u0026enc);\n\ntp_value v = tp_value_int(42);\ntp_encoder_add(enc, \"hello\", \u0026v);\n\nv = tp_value_string(\"foo\");\ntp_encoder_add(enc, \"world\", \u0026v);\n\nuint8_t *buf = NULL;\nsize_t len = 0;\ntp_encoder_build(enc, \u0026buf, \u0026len);\n\n/* Decode */\ntp_dict *dict = NULL;\ntp_dict_open(\u0026dict, buf, len);\n\ntp_value val;\nif (tp_dict_lookup(dict, \"hello\", \u0026val) == TP_OK)\n    printf(\"hello -\u003e %lld\\n\", (long long)val.data.int_val);\n\ntp_dict_close(\u0026dict);\ntp_encoder_destroy(\u0026enc);\nfree(buf);\n```\n\n### C++ API\n\n```cpp\n#include \u003ctriepack/triepack.hpp\u003e\n\ntriepack::Encoder enc;\n// ... add entries, build, lookup via triepack::Dict\n```\n\n## Library Stack\n\n```\ntriepack_json          (JSON encode/decode)\n    |\ntriepack_core          (trie codec: encoder, dictionary, iterator)\n    |\ntriepack_bitstream     (bit-level I/O, VarInt, UTF-8)\n```\n\nEach layer can be used independently. `triepack_wrapper` provides C++11 RAII wrappers over all three.\n\n## Build Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `BUILD_TESTS` | ON | Build test suite |\n| `BUILD_EXAMPLES` | ON | Build example programs |\n| `BUILD_JSON` | ON | Build JSON library |\n| `BUILD_DOCS` | OFF | Build Doxygen documentation |\n| `ENABLE_COVERAGE` | OFF | Enable code coverage instrumentation |\n\n## Language Bindings\n\nAll bindings are native implementations that read/write the `.trp` format directly (no FFI).\n\n| Language | Status | Directory |\n|----------|--------|-----------|\n| Python | Implemented | `bindings/python/` |\n| JavaScript | Implemented | `bindings/javascript/` |\n| TypeScript | Implemented (wraps JS) | `bindings/typescript/` |\n| Go | Implemented | `bindings/go/` |\n| Swift | Implemented | `bindings/swift/` |\n| Rust | Implemented | `bindings/rust/` |\n| Kotlin | Implemented | `bindings/kotlin/` |\n| Java | Implemented | `bindings/java/` |\n\n## File Format\n\n- Magic bytes: `TRP\\0` (`0x54 0x52 0x50 0x00`)\n- File extension: `.trp`\n- 32-byte fixed header\n- Two-trie architecture with configurable addressing modes\n- CRC32/SHA256/xxHash64 integrity checking\n\nSee `docs/internals/` for format details.\n\n## Documentation\n\n- [Getting Started](docs/guide/getting-started.md)\n- [Building](docs/guide/building.md)\n- [API Reference](docs/guide/api-reference.md)\n- [Examples](docs/guide/examples.md)\n- [Testing](docs/guide/testing.md)\n- [Release Process](docs/guide/release-process.md)\n\n## Project Status\n\n**v1.1.0 released.** Core C library (bitstream, trie codec, JSON), C++ wrappers, and 8 language bindings (Python, JavaScript, TypeScript, Go, Rust, Swift, Kotlin, Java) are implemented. C/C++, Python, and JavaScript maintain **100% line coverage**. 27 C/C++ test programs, 97 Python tests, 99 JavaScript tests, 75 Rust tests, 27 Swift tests, plus Go, Kotlin, and Java test suites.\n\n## Roadmap\n\n### v1.1 — Client Libraries\n- [x] TypeScript binding (wraps JS implementation)\n- [x] Go binding\n- [x] Swift binding (with SPM package)\n- [x] Rust binding (with crate on crates.io)\n- [x] Kotlin binding\n- [x] Java binding\n- [ ] npm package for JavaScript/TypeScript\n- [ ] PyPI package for Python\n\n### v1.2 — Format Enhancements\n- [ ] Suffix table (shared ending compression)\n- [ ] Huffman symbol encoding (for large dictionaries)\n- [ ] Nested dict values (embed sub-dictionaries inline)\n\n### v1.3 — Tooling \u0026 Ecosystem\n- [x] `trp` CLI: encode/decode/validate/inspect\n- [ ] Fuzzy search (edit distance d\u003c=2)\n- [ ] Performance benchmarks across languages\n- [ ] Language binding conformance test suite\n\n## License\n\nBSD-2-Clause. See [LICENSE.txt](LICENSE.txt).\n\nCopyright (c) 2026 M. A. Chatterjee\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftio%2Ftriepack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeftio%2Ftriepack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftio%2Ftriepack/lists"}