Skip to content

tfbf/usfm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USFM Parser and Converters

This is a Python module to provide a USFM parser. This project also consists of few USFM to other format converters.

Installation

To run the usfm program, you need Python 3.4 and few other third party dependencies. This is only tested in Debian GNU/Linux - Jessie version and Fedora 20. It may work in other GNU/Linux distributions also. These are the steps to install usfm program in Debian GNU/Linux and Fedora 20.

  1. Install development libraries and other dependencies as root user

    1. Debian

      # apt-get -y build-dep python3
      # apt-get -y install wget git
      
    2. Fedora

      # yum install -y yum-utils wget git
      # yum-builddep python3
      
  2. Install Python 3.4

    1. Download Python 3.4 XZ compressed source tarball

      $ wget -c https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
      
    2. Extract Python source tarball, build and install

      $ tar Jxvf Python-3.4.2.tar.xz
      $ cd Python-3.4.2
      $ ./configure --prefix=$HOME/usr
      $ make
      $ make install
      
  3. Create a virtual environment and activate it

    $ $HOME/usr/bin/pyvenv $HOME/ve
    $ source $HOME/ve/bin/activate
    
  4. Clone the parsely code from the Git repository and install it

    $ cd $HOME
    $ git clone [email protected]:python-parsley/parsley.git
    $ cd parsley
    $ python setup.py install
    
  5. Clone the usfm code from the Git repository and install it

    $ cd $HOME
    $ git clone [email protected]:tfbf/usfm.git
    $ cd usfm
    $ python setup.py develop
    
  6. Now you can run the usfm program with various arguments The syntax looks like this:

    $ usfm -c <path/to/html.cfg> -p <file/path/or/pattern> -d <output/directory> --html
    

    Examples to convert USFM files to HTML:

    $ usfm -c ../svpm/conf/html.cfg> -p ../svpm/usfm1910/*.usfm -d svpm --html