#key-value-store #adapter #info #flat #transform #refractiveindex

bin+lib ria

An adapter for converting the RefractiveIndex.INFO database into a flat, key-value store

3 releases (breaking)

0.3.0 Feb 6, 2025
0.2.0 Dec 19, 2024
0.1.0 Dec 16, 2024

#1151 in Database interfaces

Download history 107/week @ 2024-12-11 134/week @ 2024-12-18 1/week @ 2025-01-08 1/week @ 2025-01-29 159/week @ 2025-02-05

160 downloads per month

Custom license

47KB
1K SLoC

RIA: refractiveindex.info-adapters

docs.rs Crates.io Version

Adapters to transform the refractiveindex.info database into single-file key/value stores.

ria provides two tools:

  1. a Rust library containing the flattened Store datatype and methods for extracting the data, and
  2. a command line tool to parse the refractiveindex.info database into a flat key/value store and write it to file.

Quick start

Install with Cargo

The CLI tool is an optional feature that can be installed from crates.io as

cargo install ria --features cli

To install from this source code repository:

cargo install --path . --features cli

Create a single-file JSON store of the RefractiveIndex.info database

This assumes that you are currently inside the root folder of the refractiveindex.info-database repository. It will write a file called results.dat containing the data in JSON format.

ria store

Create a single-file bitcode store of the RefractiveIndex.info database

The database is in refractiveindex.info-database/database.

ria -f bitcode store -p refractiveindex.info-database/database

Create a single-file JSON store and include only keys in a file

The file should contain one key per line.

ria store -p refractiveindex.info-database/database -i misc/cherry-initial-data.txt

Validate a store

The file results.dat contains JSON data.

ria -f json validate -i results.dat

Get help

ria --help

Development

Cloning this repository

Git provides two options to clone this repository, which contains the database as a submodule:

Recurse submodules

# Assuming you're using SSH and not HTTPS

git clone --recurse-submodules git@github.com:kmdouglass/refractiveindex.info-adapters.git

Init and update

# Assuming you're using SSH and not HTTPS

git clone git@github.com:kmdouglass/refractiveindex.info-adapters.git
cd refractiveindex.info-database
git submodule init
git submodule update

Updating the database

cd refractiveindex.info-database
git fetch
git merge origin/master

Test and format

cargo test --all-features
cargo fmt

Dependencies

~0.4–1.7MB
~35K SLoC