2 unstable releases
new 0.2.0 | Dec 19, 2024 |
---|---|
0.1.0 | Dec 16, 2024 |
#1940 in Database interfaces
101 downloads per month
44KB
989 lines
RIA: refractiveindex.info-adapters
Adapters to transform the refractiveindex.info database into single-file key/value stores.
ria
provides two tools:
- a Rust library containing the flattened
Store
datatype and methods for extracting the data, and - 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
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
~36K SLoC