usfmtc


Nameusfmtc JSON
Version 0.3.13 PyPI version JSON
download
home_pageNone
SummaryUSFM reference parser
upload_time2025-07-14 07:26:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # USFMTC Module

## Introduction

The USFMTC module is a module for reading and writing [USFM](docs.usfm.bible) scripture files in
all their formats: USFM, USX and USJ. It is designed to be a reference
implementation of the standard. It also has support for Scripture References.

```
import sys, usfmtc
from usfmtc.versification import cached_versification
from usfmtc.reference import Ref, RefList

engvrs = cached_versification("eng")   # can also be a path to a .vrs file
usxdoc = usfmtc.readFile(sys.argv[1])
usxdoc.canonicalise()
# usxdoc.reversify(engvrs, None)
usxdoc.saveAs(sys.argv[2])

r = Ref("ISA 9:1-4")      # returns a RefRange
canr = engvrs.remap(r, None)    # one way conversion
print(canr)     # prints "ISA 8:23-9:3"
rlist = RefList("JHN 3:16, GEN 1:1, PSA 23, ISA 53, PSA 23:1")
print(rlist.simplify())     # GEN 1:1; PSA 23; ISA 53; JHN 3:16
print(Ref("PSA 23").end())  # PSA 23:6
print(Ref("PSA 23:10").isvalid())   # False

newdoc = usxdoc.getrefs(Ref("PSA 23:2-4"))
print(newdoc.outUsfm(None))     # A new doc of just PSA 23:2-4
```

The internal representation of the data is as an ElementTree structure
conforming to the USX standard.

See the tests/test_\*.py files for more examples. See also pydoc usfmtc.

## Utilities

usfmtc comes with a few utilities:

- usfmconv. Converts from one serialisation to another
- usfmreversify. Change the versification of a file to something different


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "usfmtc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "USFM Technical Committee <fonts@sil.org>",
    "download_url": "https://files.pythonhosted.org/packages/f2/b8/440c383c565a116888f1752834bd51c2124d5d7d3ff8fb8c2610d357e56d/usfmtc-0.3.13.tar.gz",
    "platform": null,
    "description": "# USFMTC Module\n\n## Introduction\n\nThe USFMTC module is a module for reading and writing [USFM](docs.usfm.bible) scripture files in\nall their formats: USFM, USX and USJ. It is designed to be a reference\nimplementation of the standard. It also has support for Scripture References.\n\n```\nimport sys, usfmtc\nfrom usfmtc.versification import cached_versification\nfrom usfmtc.reference import Ref, RefList\n\nengvrs = cached_versification(\"eng\")   # can also be a path to a .vrs file\nusxdoc = usfmtc.readFile(sys.argv[1])\nusxdoc.canonicalise()\n# usxdoc.reversify(engvrs, None)\nusxdoc.saveAs(sys.argv[2])\n\nr = Ref(\"ISA 9:1-4\")      # returns a RefRange\ncanr = engvrs.remap(r, None)    # one way conversion\nprint(canr)     # prints \"ISA 8:23-9:3\"\nrlist = RefList(\"JHN 3:16, GEN 1:1, PSA 23, ISA 53, PSA 23:1\")\nprint(rlist.simplify())     # GEN 1:1; PSA 23; ISA 53; JHN 3:16\nprint(Ref(\"PSA 23\").end())  # PSA 23:6\nprint(Ref(\"PSA 23:10\").isvalid())   # False\n\nnewdoc = usxdoc.getrefs(Ref(\"PSA 23:2-4\"))\nprint(newdoc.outUsfm(None))     # A new doc of just PSA 23:2-4\n```\n\nThe internal representation of the data is as an ElementTree structure\nconforming to the USX standard.\n\nSee the tests/test_\\*.py files for more examples. See also pydoc usfmtc.\n\n## Utilities\n\nusfmtc comes with a few utilities:\n\n- usfmconv. Converts from one serialisation to another\n- usfmreversify. Change the versification of a file to something different\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "USFM reference parser",
    "version": "0.3.13",
    "project_urls": {
        "Home-Page": "https://github.com/usfm-bible/usfmtc"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "683a6933b20c59d188990f7df0ffe59cf08f8c3aa6979850c94cf4d31103ad41",
                "md5": "e4bf10f4c18cd28bb0b0fa5b7c31bc15",
                "sha256": "25d89e07c9f7a8df9eaa44d3528a51576ba238f569c704a3436521befe24e505"
            },
            "downloads": -1,
            "filename": "usfmtc-0.3.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4bf10f4c18cd28bb0b0fa5b7c31bc15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 84519,
            "upload_time": "2025-07-14T07:25:58",
            "upload_time_iso_8601": "2025-07-14T07:25:58.933411Z",
            "url": "https://files.pythonhosted.org/packages/68/3a/6933b20c59d188990f7df0ffe59cf08f8c3aa6979850c94cf4d31103ad41/usfmtc-0.3.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f2b8440c383c565a116888f1752834bd51c2124d5d7d3ff8fb8c2610d357e56d",
                "md5": "4d447d6a347559822035e3b53d31fcc2",
                "sha256": "6574e3288b4e376fdf95429a94127c8b683533ad8e1e201d149ffb2c922cd691"
            },
            "downloads": -1,
            "filename": "usfmtc-0.3.13.tar.gz",
            "has_sig": false,
            "md5_digest": "4d447d6a347559822035e3b53d31fcc2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 92696,
            "upload_time": "2025-07-14T07:26:00",
            "upload_time_iso_8601": "2025-07-14T07:26:00.255065Z",
            "url": "https://files.pythonhosted.org/packages/f2/b8/440c383c565a116888f1752834bd51c2124d5d7d3ff8fb8c2610d357e56d/usfmtc-0.3.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 07:26:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "usfm-bible",
    "github_project": "usfmtc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "usfmtc"
}
        
Elapsed time: 0.46070s