Pa

Paradict – Streamable multi-format serialization with schema

Hacker News

Paradict – Streamable multi-format serialization with schema

Hi HN ! I'm Alex, a tech enthusiast. I'm excited to show you Paradict ( https://github.com/pyrustic/paradict ), my solution for streamable multi-format serialization. Although JSON, YAML, and TOML are all human-readable, they serve different purposes. For example, TOML is specifically designed for configuration files while JSON is used as a data interchange format. Sometimes an initiative to create a binary version of JSON arises and as far as I know, it ends with an unidirectional mapping of datatypes. There is no silver bullet, yet one coherent solution built from scratch that addresses multi-format (binary and textual) serialization and configuration files would be a step forward. Earlier this year, I accidentally designed a textual data format to represent complex data structures inside a document divided into sections. The project, namely Jesth (Just Extract Sections Then Hack'em), generated an interesting discussion on HN ( https://news.ycombinator.com/item?id=35991018 ). Out of curiosity, I ran some benchmarks using Jesth, JSON and MessagePack, with and without Gzip compression against a large JSON file downloaded from the web. The benchmarking gave me insights that led to the decision to evolve Jesth's ideas into a new multi-format serialization solution. I designed and built Paradict from scratch to serialize and deserialize a dictionary data structure. Although Paradict's root data structure is a dictionary, lists, sets, and dictionaries can be nested within it at arbitrary depth. A Paradict dictionary can be populated with strings, binary data, integers, floats, complex numbers, booleans, dates, times, datetimes, comments, extension objects, and grids (matrices). There is also a schema-based validation mechanism that can contain programmatic checkers. The binary serialization format is designed with compactness in mind such as Pi with its first two decimal places, the Golden ratio with its first two decimal places, and the date of the funeral of Pope Benedict XVI would each be encoded on two bytes (not counting their respective 1-byte tag which starts each Paradict binary datum). This binary format has two levels of granularity for continuous data stream processing: a datum at the low level, which is in some cases a 2-tuple composed of a tag and its payload, and the message at the high level which is a dictionary data structure. The textual serialization format has two modes: data and config modes. Config mode implicitly treats dictionary keys as strings, removing the need to surround them with quotes, and unlike the colon (:) between a key-value pair in data mode, it uses the equal sign (=) as separator. This textual format has two levels of granularity for continuous data stream processing: a single line of text at the low level and the message at the high level which is a dictionary data structure. Here is a valid Paradict configuration document that contains a "user" section: [user] # no comment id = 42 name = 'alex' birthday = 2042-12-25T16:20:59Z photo = (bin) 54 68 69 73 20 69 73 20 6E 6F 74 20 61 20 70 68 6F 74 6F 67 72 61 70 68 weight_matrix = (grid) 1 0 1 0 0 1 0 1 1 0 1 0 books = (dict) romance = (list) 'Happy Place' 'Romantic Comedy' sci_fi = (list) 'Dune' 'Neuromancer' epitaph = (text) According to the law of conservation of energy, no a bit of you is gone; you are just less orderly. --- Under the hood, Paradict uses Braq ( https://github.com/pyrustic/braq ), the most obvious way to section a document (as shown just above), and Ustrid ( https://github.com/pyrustic/ustrid ), to uniquely generate string identifiers. Paradict is available on PyPI and you can learn more by reading its README, browsing the source code or playing with its tests. Let me know what you think about all this !

Share card

Actual performance

14points
6comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: para, ios · Missing: supports, reddit linkedin, podcasting
92%92% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: excited, ide, io · Missing: https docs, just released, exist
62%62% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Product HuntOn track for Day 1 leaderboard · Strong signals: user, new, single · Missing: mac, agents, macos
56%56% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: ios, way, para · Missing: mobile apps, personal, entrepreneurs
40%40% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
38%38% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
11%11% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

fc
fcode is a binary rust-serde format that supports schema evolution45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

fcode is a binary rust-serde format that supports schema evolution

Hacker News14
Be
Bebop – An Efficient, Schema-Based Binary Serialization Format52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Bebop – An Efficient, Schema-Based Binary Serialization Format

Hacker News16
Pe
Percona Migrator – online MySQL schema migrations in Rails34%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Percona Migrator – online MySQL schema migrations in Rails

Hacker News11
SA
SAN syntax for Vim – a Sane and Nice configuration format59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SAN syntax for Vim – a Sane and Nice configuration format

Hacker News1
Th
The CFG Configuration Format51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The CFG Configuration Format

Hacker News1
Cl
Clang_format_all – Configure clang-format with YAML49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Clang_format_all – Configure clang-format with YAML

Hacker News1
Ra
Ragzip format specification (and Java implementation)53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Ragzip format specification (and Java implementation)

Hacker News4
Gr
GraphQL simple schema stitching with pseudofragments69%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GraphQL simple schema stitching with pseudofragments

Hacker News2
GD
GDSerialize: Godot 4 schema-based serializer51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GDSerialize: Godot 4 schema-based serializer

Hacker News1
En
Enforced, Annotated Schema for Ruby Sequel Models46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Enforced, Annotated Schema for Ruby Sequel Models

Hacker News22