Nim implementation of the Preserves data language
Find a file
2024-10-03 15:15:20 +01:00
src preserves_schema_nim: convert kebab-case types to camel-case 2024-10-03 15:15:20 +01:00
tests Attempt at switching from |...| to '...' for symbol quoting 2024-09-30 16:55:14 +01:00
.gitignore Build system refactor 2024-06-08 17:43:18 +03:00
default.nix Build system refactor 2024-06-08 17:43:18 +03:00
depends.tup Build metadata 2024-08-14 17:57:31 +01:00
lock.json Split pkSignedInteger into pkRegister and pkBigInt 2024-01-01 17:32:50 +02:00
preserves.nimble *.nimble: swap nim:bin key and value 2024-09-30 16:29:08 +01:00
README.md Build system refactor 2024-06-08 17:43:18 +03:00
sbom.json preserves_schema_nim: convert kebab-case types to camel-case 2024-10-03 15:15:20 +01:00
schema.bin Remove submodule 2022-02-19 10:33:16 -06:00
schema.prs Replace #! notation with #: 2024-02-08 14:24:01 +00:00
Tupfile Build system defactor 2024-06-23 15:28:10 +03:00
Tuprules.jq Build system defactor 2024-06-23 15:28:10 +03:00
Tuprules.tup Add lockfile 2023-10-19 18:14:14 +01:00
UNLICENSE Unlicense 2021-08-31 17:00:00 +02:00

Preserves

Nim implementation of the Preserves data language.

If you don't know why you need Preserves, see the Syndicate library.

Library

To parse or produce Preserves one should write a schema and generate a Nim module using the preserves_schema_nim utility. This module will contain Nim types corresponding to schema definitions. The toPreserve andfromPreserve routines will convert Nim types to and from Preserves. The decodePreserves, parsePreserves, encode, and $ routines will convert Preserve objects to and from binary and textual encoding.

To debug the toPreserves and fromPreserves routines compile with -d:tracePreserves.

Utilities

  • preserves-schema-nim
  • preserves-encode
  • preserves-decode
  • preserves-from-json
  • preserves-to-json
  • preserves-from-xml
  • preserves-to-xml

Installation

preserves_encode is a multi-call binary that implements preserves-encode, preserves-decode, preserves-from-json, and preserves-to-json, so the appropriate symlinks should be created during packaging.