No description
  • Rust 93.8%
  • Python 4%
  • Nix 2.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-19 10:34:35 +02:00
.vscode added lsp-settings 2026-07-28 01:27:16 +02:00
crates bible_key/canons: add/sub books 2026-10-19 10:34:35 +02:00
scripts bible_key: books parsing ignores case 2026-10-02 18:44:43 +02:00
test install manager (#1) 2026-05-20 14:58:48 +02:00
.gitignore gitignore: added /repl.* 2026-04-26 03:08:59 +02:00
Cargo.lock rename crates/rsword_* -> crates/* 2026-10-14 14:37:26 +02:00
Cargo.toml bible_key/parse: better parse BibleKeyOrRange 2026-10-03 00:14:40 +02:00
deny.toml start with python bindings + use crane 2026-04-25 19:28:59 +02:00
flake.lock nix: update 2026-10-14 14:46:11 +02:00
flake.nix rename crates/rsword_* -> crates/* 2026-10-14 14:37:26 +02:00
LICENSE added license 2026-03-09 21:47:44 +01:00
README.md updated README 2026-10-17 15:01:04 +02:00
shell.nix shell.nix: added cargo-nextest 2026-10-05 12:38:26 +02:00
taplo.toml start with python bindings + use crane 2026-04-25 19:28:59 +02:00

RSword

WARNING

This project is work in progress, so expect the API to break.

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

  • Morphology
  • Parse GBF
  • 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)
  • Less stable/mature

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.