No description
  • Rust 88.9%
  • Python 8.7%
  • Nix 2.4%
Find a file
2026-07-01 11:56:08 +02:00
crates config/module/Category: fix serialize 2026-07-01 11:56:08 +02:00
scripts versification/canons: important fix 2026-07-01 11:55:00 +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 versification: improved BibleKeyRange + mappings between them 2026-06-19 12:08:20 +02:00
Cargo.toml versification: improved BibleKeyRange + mappings between them 2026-06-19 12:08:20 +02:00
deny.toml start with python bindings + use crane 2026-04-25 19:28:59 +02:00
flake.lock flake: update 2026-07-01 11:51:53 +02:00
flake.nix fix: move json data into rsword-macros 2026-06-16 12:59:38 +02:00
LICENSE added license 2026-03-09 21:47:44 +01:00
README.md readme: added copyright notice 2026-05-25 12:15:48 +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 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)

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.