cvdb
JSON Lines utilities for reading compact value documents.
The Rust library streams JSON values from a buffered reader. The TypeScript
module parses JSON Lines text. Both ignore blank lines and reject invalid JSON.
The Rust command reads a file or standard input and emits compact JSON Lines,
or checks the input with --check.
Rust
use std::io::Cursor;
let input = Cursor::new("{\"id\":1}\n{\"id\":2}\n");
let records = cvdb::values(input).collect::<std::io::Result<Vec<_>>>().unwrap();
assert_eq!(records.len(), 2);
TypeScript
import { parseJsonLines } from "@corbet-labs/cvdb";
const records = parseJsonLines('{"id":1}\n{"id":2}\n');
Use jsr:@corbet-labs/cvdb for Deno. npm ships generated JavaScript and
TypeScript declarations; JSR ships the TypeScript source.
Command
cargo install cvdb
cvdb records.jsonl
cvdb --check records.jsonl
With no file argument, cvdb reads standard input. --check emits the number
of valid records. Invalid JSON and input/output failures return a nonzero exit
status. Output is streamed, so an error can follow already-emitted records.
The PyPI package distributes the same native Rust command; its first wheel
supports Linux x86-64. It provides no Python import API.
License
Functional Source License, Version 1.1, ALv2 Future License
(FSL-1.1-ALv2). Each version becomes available under Apache-2.0 two years
after it is first made available.
Metadata
Release files for cvdb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cvdb-0.1.0-py3-none-manylinux_2_34_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64 | Details |
Release files / cvdb-0.1.0-py3-none-manylinux_2_34_x86_64.whl
| Download URL | cvdb-0.1.0-py3-none-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 381.4 kB |
| Tags | Linux glibc 2.34+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
250e9f12a8c14576293791de4c3de4c2884e9cb4930f5802276b866d3e665cf0
|
|
BLAKE2b-256 checksum How to use checksums |
419cca0d3216ee16ca15258868367066fbac8656183e002753bcd44a7d66e137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|