Reusable sermon transcription and Bible verse suggestion engine.
devar-engine is the Python engine package for building sermon-assistant
workflows. It can transcribe sermon audio, maintain rolling transcript files,
and suggest Bible verses from a local JSON Bible file. It works as a
command-line tool for local experiments and as a library that can be imported by
a backend service.
Install from PyPI:
python -m pip install devar-engineInstall with local microphone support:
python -m pip install "devar-engine[audio]"Install with local Moonshine transcription support:
python -m pip install "devar-engine[transcription]"Install both microphone capture and transcription support:
python -m pip install "devar-engine[all]"Install from a checked-out repository while developing:
cd /path/to/devar.engine
python -m pip install -e ".[all]"Verse suggestions require a local Bible JSON file. The expected shape is a flat array of verse objects:
[
{
"book": "John",
"chapter": 3,
"verse": 16,
"text": "For God so loved the world..."
}
]Required fields:
book: Bible book name.chapter: Chapter number.verse: Verse number.text: Verse text.
An optional translation field is accepted, but it is not required. Bible files
are runtime data and should not be committed to source control unless you have
the right to distribute them.
devar-engine installs two console commands:
devar-engine-transcribe: transcribes audio into a transcript file.devar-engine-suggest: suggests Bible verses from transcript text or an ad-hoc query.
devar-engine-suggest query \
--bible data/nkjv.json \
--text "Do not be anxious about anything" \
--top-k 5Run one suggestion cycle:
devar-engine-suggest once \
--bible data/nkjv.json \
--transcript-file transcripts/live.jsonlWatch a transcript and print suggestions repeatedly:
devar-engine-suggest loop \
--bible data/nkjv.json \
--transcript-file transcripts/live.jsonl \
--interval-seconds 10 \
--last-seconds 15devar-engine-transcribe \
--source wav-file \
--input recordings/sermon.wav \
--duration 3600 \
--transcript-output transcripts/sermon.jsonl \
--no-audio-outputFor best results, use uncompressed WAV audio with:
- 16 kHz sample rate.
- 16-bit signed PCM samples.
- Mono audio.
Install the audio and transcription extras first:
python -m pip install "devar-engine[all]"List available input devices:
devar-engine-transcribe --list-devicesRecord and transcribe:
devar-engine-transcribe \
--source microphone \
--duration 3600 \
--transcript-output transcripts/live.jsonl \
--audio-output recordings/live.wavdevar-engine-transcribe \
--source tone \
--duration 5 \
--transcript-output transcripts/tone.jsonl \
--no-audio-outputfrom pathlib import Path
from devar_engine.suggestions import BibleIndex, keyword_suggest
bible = BibleIndex(Path("data/nkjv.json"))
results = keyword_suggest(
bible,
"God loved the world and gave His Son",
top_k=3,
)
for result in results:
print(result.reference)
print(result.display_text)from pathlib import Path
from devar_engine.suggestions import read_recent_context
text, timestamp_range = read_recent_context(
Path("transcripts/live.jsonl"),
last_seconds=15,
)from devar_engine.transcription import transcribe_wav_bytes
with open("recordings/sermon.wav", "rb") as f:
wav_bytes = f.read()
text = transcribe_wav_bytes(wav_bytes)from devar_engine.audio import AudioSettings, pcm_to_wav_bytes
settings = AudioSettings(sample_rate=16000, channels=1, sample_width=2)
wav_bytes = pcm_to_wav_bytes(raw_pcm_bytes, settings)JSONL transcript entries are written one object per line:
{"timestamp": "00:00 - 00:05", "text": "Grace and peace to you"}The suggestion command reads the most recent timestamped entries when possible. For plain-text transcripts, it falls back to the last characters in the file.
Typical local directories:
data/ Bible JSON files
recordings/ optional WAV recordings
transcripts/ generated transcript files
Treat these as local runtime directories. Generated transcripts, recordings, and licensed Bible files should normally stay out of git.
Devar Engine is licensed under the Apache License 2.0.
This package does not include Bible translations, recordings, transcripts, speech model weights, or other runtime data. Those assets may have their own licenses and usage restrictions.
Run the package tests from this directory:
PYTHONPATH=src PYTHONDONTWRITEBYTECODE=1 python -m unittest discover -s tests -vRun a CLI smoke test with a local Bible file:
PYTHONPATH=src python -m devar_engine.cli.suggest query \
--bible data/nkjv.json \
--text "The Lord is my shepherd"Build and verify distributions from the repository root:
python -m pip install -e ".[dev]"
python -m build
python -m twine check dist/*Test a release on TestPyPI first:
python -m twine upload --repository testpypi dist/*
python -m pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
devar-enginePublish the real release to PyPI:
python -m twine upload dist/*GitHub Actions workflows are also included for TestPyPI and PyPI publishing.
They are triggered manually with workflow_dispatch or automatically when you
push a tag like devar-engine-v0.1.2.
Bible file not found
Pass --bible /path/to/bible.json, or place the file where your command expects
it.
No suggestions
Make sure the transcript has meaningful sermon text and the Bible file uses the required flat verse-object shape.
WAV file settings do not match
Use 16 kHz, 16-bit, mono WAV input, or convert the file before passing it to
devar-engine-transcribe.