Skip to main content

KFST

KFST is a finite state transducer library written in pure Python. It supports reading transducers from AT&T tabular format files and its own binary format. In addition to standard features, it also supports flag diacritics.

The intended use case is to use KFST in environments in which native libraries like HFST cannot be installed.

Installation

KFST is available on PyPI and can be installed with pip:

pip install kfst

Usage

In this example, we assume that you have a transducer stored in the file my-transducer.att. You can easily create such file using the HFST toolkit:

hfst-fst2txt -f att my-transducer.hfst > my-transducer.att

# if you want a kfst file:
python -m kfst.convert my-transducer.att my-transducer.kfst

Reading transducers

Transducers can be read from AT&T tabular format files using the read_att_file function, and the KFST binary format using the read_kfst_file function:

from kfst import FST

fst = FST.read_att_file("my-transducer.att")
# or
fst = FST.read_kfst_file("my-transducer.kfst")

Using the transducer

To run the transducer, use the lookup method, which returns a list of tuples of the form (output, weight) sorted by weight:

fst.lookup("foo")

License

KFST is licensed under the GNU LGPL version 3 or later. See the LICENSE file for details.

Metadata

Release files for kfst 4.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kfst 4.3.3
File Size Uploaded Provenance Actions
kfst-4.3.3.tar.gz 14.2 kB Without provenance Details for kfst-4.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kfst 4.3.3
File Interpreter ABI Platform Actions
kfst-4.3.3-py3-none-any.whl Python 3 none any Details for kfst-4.3.3-py3-none-any.whl

Total release size: 34.2 kB

Release files / kfst-4.3.3.tar.gz

Download URL kfst-4.3.3.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a4af67d1604726f07f5d1fd5a17d3aae4e3d07f29055472a35bd32ff271ae75e
BLAKE2b-256 checksum
How to use checksums
2402019179a0f758cb36beddacb44e350017975485e69c4f3d5ac54a5548af56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / kfst-4.3.3-py3-none-any.whl

Download URL kfst-4.3.3-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f8df5d768bdae67390cc2b9a2aa67163d9e3d1740b39bc9646de70b74b1da2d
BLAKE2b-256 checksum
How to use checksums
101f5819392c356407386fbf9b0e981c4dfd0c171fd976c507a01ca06c6278e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for kfst 4.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page