textgrid_editor is yet another python module for modifying with Praat TextGrid files. Also provides APIs for editing TextGrids and converting between TextGrids and pandas DataFrames.
-
Regex Parsing: It uses regular expressions (re) to identify the specific structure of a Praat file (headers, item classes etc.).
-
Pandas Integration: It stores the annotation data in a Pandas DataFrame. This makes it very powerful for analyzing, filtering, or modifying large amounts of phonetic data.
-
Gap Filling: It includes a utility function fill_interval_df_gaps to "repair" TextGrids by filling in silent/empty spaces between defined intervals, ensuring the timeline is continuous.
-
Serialization: It can convert the Python object back into the text string format required by Praat files. Dict and DataFrame are also supported.
-
Support TextGrid editing, that is, cropping/extending and concatenating TextGrids.
[ ] 将转换脚本作为打包的一部分提供
[ ] 支持处理非标准的TextGrid文件, 并修复存在的错误
[ ] 支持short format TextGrid读写
Install this package via pip, like so:
# To install the latest stable release (1.0.x)
pip install textgrid_editor
# To install textgrid_editor and develop locally:
# git clone https://github.com/hellolzc/textgrid_editor
# cd textgrid_editor
# pip install --editable ./You also can put this code in your working directory or in your $PYTHONPATH.
See example-how-to-use.py.