Skip to main content

Stand-alone OpenFST bindings for Python

Project description

OpenFst-Python

Build Status Python Version Code Style

OpenFst-Python exposes the official Python API to OpenFst (officially called pywrapfst), but includes all the required OpenFst libraries in the Python package, so you don't need to install it separately.

The version number of OpenFst-Python is the same as the OpenFst version used. The current version uses OpenFst 1.7.2.

Build Requirements

The build process will download and build OpenFst from the official webpage, so you need an Internet connection and all OpenFst dependencies. Essentially, you will need:

Installation

Most likely, you want to avoid the build process. Then, simply install the package from PyPI:

pip install openfst-python

Alternatively, if you are installing from sources, you can simply do:

python setup.py install

Notice that this downloads the appropriate version of OpenFst directly from the Internet. If you don't have an Internet connection but are already in possession of the appropriate tar.gz file, you can use the following command:

python setup.py build --download-dir=DIRECTORY_CONTAINING_OPENFST_TAR_GZ
python setup.py install

Documentation

The Python API is the official one provided by OpenFst. Please, refer to its documentation.

A toy example:

import openfst_python as fst

f = fst.Fst()
s0 = f.add_state()
s1 = f.add_state()
s2 = f.add_state()
f.add_arc(s0, fst.Arc(1, 2, fst.Weight(f.weight_type(), 3.0), s1))
f.add_arc(s0, fst.Arc(1, 3, fst.Weight.One(f.weight_type()), s2))
f.add_arc(s1, fst.Arc(2, 1, fst.Weight(f.weight_type(), 1.0), s2))
f.set_start(s0)
f.set_final(s2, fst.Weight(f.weight_type(), 1.5))

License

The OpenFst library is licensed under the Apache License, Version 2.0. OpenFst-Python is just a wrapper of its official Python API, so I am using the same license for most of the source code. ac_python_devel.m4 was not written by me and it is licensed under the GPL license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openfst_python-1.7.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distributions

openfst_python-1.7.2-cp37-cp37m-manylinux1_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.7m

openfst_python-1.7.2-cp36-cp36m-manylinux1_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.6m

openfst_python-1.7.2-cp35-cp35m-manylinux1_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.5m

openfst_python-1.7.2-cp27-cp27mu-manylinux1_x86_64.whl (15.0 MB view details)

Uploaded CPython 2.7mu

File details

Details for the file openfst_python-1.7.2.tar.gz.

File metadata

  • Download URL: openfst_python-1.7.2.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for openfst_python-1.7.2.tar.gz
Algorithm Hash digest
SHA256 d71305d9ce3e9dde73723c8f9655db566399c561c45da4defbe3b08cf58bdcc5
MD5 e9cb7eaed26b6d0e0b5cb0aafbf1f497
BLAKE2b-256 cb5f3ac14e33731746f20faa1f3ae627314f05ff041cce32f3f2e91777935c5e

See more details on using hashes here.

File details

Details for the file openfst_python-1.7.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: openfst_python-1.7.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for openfst_python-1.7.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dfae536f4a60ca226269fe3284b624f0dc3ff556f380d304bf0ab470f4bfe2ac
MD5 2c30b7435ad7b99bd5822472d34c48d0
BLAKE2b-256 18db694a9e922fbf8c43fedee6a8ed87d2ce4faf6df2b5c47abb2c3baf0a75d2

See more details on using hashes here.

File details

Details for the file openfst_python-1.7.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: openfst_python-1.7.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for openfst_python-1.7.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 31344cb1504d3c68820d67ff0e592bc5b36fd43f21d7602318a3dffcd8722d00
MD5 73df89f2d9eefbcf56a3d3e67937761c
BLAKE2b-256 3b9a6eed871217c6a3185ff22ea7ab9aea755f16fea1f703fe8b4eed95f7229d

See more details on using hashes here.

File details

Details for the file openfst_python-1.7.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: openfst_python-1.7.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for openfst_python-1.7.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 39f2fc22ace76a0d20a790517a37205e76fdf8fb319a7dc6c1ba8014fb139ad3
MD5 614392fca89de0581fa84d173cdb104d
BLAKE2b-256 66c6b6eddaee59da7a306dfd9ae0162895eb39cf057ed0e90b2d558d6b69fa45

See more details on using hashes here.

File details

Details for the file openfst_python-1.7.2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: openfst_python-1.7.2-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for openfst_python-1.7.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 efdf88b59605e2047aa818b682739af47e5dfc052e6872d388176d3f3583a57a
MD5 e8b7cf43a198e1d4fba4f131dd0b459e
BLAKE2b-256 83e1bffc360daf50b3f6265be16d711d27715c05316242857193b9ee1fd9566d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page