Parser

USFM Grammar

Elegant USFM parsing and validation.

USFM Grammar interface

What it is for

A tree-sitter grammar that reads USFM 3.x, checks it, and converts it to JSON and back.

USFM Grammar is a parser and validator for Unified Standard Format Markers. The grammar is a context-free model of USFM, written with tree-sitter and a Generalized LR parser, and it supports USFM 3.x.

Parsed Scripture becomes a syntax tree, then an easier structure for tools to use: USJ JSON, USX XML, CSV or TSV, and BibleNLP. The same library can convert those formats back to USFM. Markers can be included or excluded, errors can be reported, and an experimental auto-fix can repair common problems.

Bindings are available for Python, Node.js, and the web, with a command-line interface through the Python package. The browser demo lets you paste USFM and inspect the converted result immediately.

Who it is forDevelopers building Scripture translation tools, pipelines, and publishing systems.

  1. 01USFM 3.x with tree-sitter
  2. 02USJ, USX, CSV, and BibleNLP
  3. 03Validate, and convert back to USFM
  4. 04Python, Node.js, web, and a CLI

The interface.

Screens from the product. Open any frame for a closer look.

A quick tour.

Play through the interface. The reel runs for half a minute and you can scrub to any moment.

USFM Grammar converter with source and target panes
0:00 / 0:30

Converter

Download

Get it directly.

Direct download is the source archive. Install the library with pip install usfm-grammar or npm install usfm-grammar. Try the converter on the product website before you install.

Download source

Product website

See it live.

Open the official USFM Grammar website for the live tool, documentation, and the latest public release.

Explore product website

Contact BCS

Talk with Bridge Connectivity Solutions.

USFM Grammar is part of Vachan.org, built by Bridge Connectivity Solutions Pvt. Ltd. (BCS). Write or call if you want a walkthrough, a deployment conversation, or help choosing the right tool.

Office
1st Floor, Plot Nos. 11- 13, Amberhai Main Road, Sector 19, Dwarka, New Delhi - 110075, India.