A compact configuration format designed to be easily read- and writeable. The name comes from music — a coda is the concluding passage that ties a composition together. A .coda file is the single source of truth for configuration.
The above file in JSON:
- Whitespace-sensitive, line-oriented.
- Every leaf value is a string; interpretation is left to the consumer.
- Quotes are optional unless a value contains whitespace or syntax characters (
{}[]"#). - Comments are preserved and attach to the node that follows them.
Coda has three structural constructs: blocks {}, arrays [], and tables (inferred from array headers). For the full language specification, see docs/SPEC.md.
Python — install the pre-built package from PyPI (includes the compiled native library):
pip install coda-formatimport coda
with coda.Doc.parse_file("config.coda") as doc:
print(doc.root()["key"])C++ — Coda is a header-only library. Copy or symlink include/coda.hpp and #include it directly — no build step required.
#include "path/to/coda.hpp"C FFI / other languages — build the shared library with just build (see Building & testing below).
| API | File |
|---|---|
C++ header (include/coda.hpp) |
docs/API-CPP.md |
Python bindings (bindings/python/coda.py) |
docs/API-PYTHON.md |
C FFI (ffi/coda_ffi.h) |
docs/API-C-FFI.md |
This repo is built and tested via just.
just generate # regenerate include/coda.hpp (requires quom)
just build # build host shared library (libcoda_ffi.so)
just cross-all # cross-compile for all supported targets
just test # run all tests
just test-cpp
just test-c-ffi
just test-py-ffiCross-compiled FFI artifacts are placed under dist/<target>/.