ria

Crates.ioria
lib.rsria
version0.3.0
created_at2024-12-16 12:35:26.239673+00
updated_at2025-02-06 15:52:02.955368+00
descriptionAn adapter for converting the RefractiveIndex.INFO database into a flat, key-value store.
homepage
repositoryhttps://github.com/kmdouglass/refractiveindex.info-adapters
max_upload_size
id1484957
size66,363
Kyle M. Douglass (kmdouglass)

documentation

README

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
Commit count: 44

cargo fmt