No description
- Rust 88.9%
- Python 8.7%
- Nix 2.4%
| crates | ||
| scripts | ||
| test | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| deny.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| taplo.toml | ||
RSword
WARNING
This project is work in progress, so API might change.
Example Usage
use rsword::core::{BibleKey, LazyBible, LoadedBible, Manager, Plain};
// For this to work, you will need local sword modules installed (in this case ASV).
// For example, you can do this via one of the applications at https://crosswire.org/applications/
let manager = Manager::new()?;
// lazy bible loading + the Plain format
let mut asv: LazyBible<Plain> = manager.get_lazy_bible("asv", None)?;
let verse = asv.get(&BibleKey::from_str("2 Pet 1:19")?)?;
assert_eq!(Plain("And we have the word of prophecy [made] more sure; whereunto ye do well that ye take heed, as unto a lamp shining in a dark place, until the day dawn, and the day-star arise in your hearts: ".to_string()), verse);
// full bible loading + the Raw format
let asv: LoadedBible<String> = manager.get_loaded_bible("asv", None)?;
let verse = asv.data.get(&BibleKey::from_str("2 Pet 1:19")?).unwrap();
assert_eq!(
"<w lemma=\"strong:G2532\">And</w> <w lemma=\"strong:G3739\">we</w> <w lemma=\"strong:G2192\">have</w> <w lemma=\"strong:G3588\">the</w> <w lemma=\"strong:G3056\">word</w> <w lemma=\"strong:G3056\">of</w> prophecy <transChange type=\"added\"><w lemma=\"strong:G4160\">made</w></transChange> <w lemma=\"strong:G949\">more</w> <w lemma=\"strong:G949\">sure</w>; whereunto ye <w lemma=\"strong:G4160\">do</w> <w lemma=\"strong:G2573\">well</w> <w lemma=\"strong:G3739\">that</w> ye <w lemma=\"strong:G4337\">take</w> heed, <w lemma=\"strong:G5613\">as</w> unto <w lemma=\"strong:G2192\">a</w> <w lemma=\"strong:G3088\">lamp</w> <w lemma=\"strong:G5316\">shining</w> <w lemma=\"strong:G1722\">in</w> <w lemma=\"strong:G2192\">a</w> dark <w lemma=\"strong:G5117\">place</w>, <w lemma=\"strong:G2193\">until</w> <w lemma=\"strong:G3588\">the</w> <w lemma=\"strong:G2250\">day</w> dawn, <w lemma=\"strong:G2532\">and</w> <w lemma=\"strong:G3588\">the</w> day-star arise <w lemma=\"strong:G1722\">in</w> <w lemma=\"strong:G2192\">your</w> <w lemma=\"strong:G2588\">hearts</w>: ",
verse
);
About
This is a Rust library providing access the bible in the form of sword modules, giving access to the big library of biblical texts that crosswire kindly provides.
Features
- Load configs
- Loading modules from disk
- Install modules from web
- Basic cli
- Parse to Plain format
Missing Features
- Advanced OSIS handling
- Advanced TEI handling
- Advanced ThML handling
- Parse GBF
- Provide offsets between versification's
- Many, many edge cases
Comparison to the original C++ sword engine
Advantages
- Code is simpler (thanks to high-level Rust)
- Better API for some use cases
- more types (e.g. book names are not strings)
Limitation
- Less features (see above)
- Might be slower (not tested)
Copyright
This project is licensed under GPL-2.0-only, similar to the original SWORD project.
Copyright (C) 2026 Len-Noah Lazarus
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.