Production-oriented TextGrid, JSON, and MLF toolkit.
Project description
uxtg
uxtg 是一个面向生产集成的 Python 库,用于处理 Praat TextGrid、稳定 JSON 文档协议,以及 HTK MLF 转换流程。
Features
- 分层架构:
domain、codecs、documents、mappers Pydantic v2核心领域模型- Praat
TextGrid/TextTier/IntervalTier读写 - 稳定的
TextGridJsonDocument导出与反向映射 MLF -> TextGrid转换和 TextGrid 文件落盘- 统一异常体系与库级 facade API
Installation
poetry add uxtg
Stable API
import uxtg
grid = uxtg.read_textgrid("sample.TextGrid", strict=True)
document = uxtg.textgrid_to_json_document(grid)
restored = uxtg.json_document_to_textgrid(document)
mlf = uxtg.read_mlf("labels.mlf")
Public Objects
Point,Interval,PointTier,IntervalTier,TextGridTextGridJsonDocumentMLF
Public Functions
parse_textgrid(text, *, round_digits=..., strict=True)read_textgrid(path, *, round_digits=..., strict=True, encoding=None)write_textgrid(textgrid, target, *, null="")read_mlf(path_or_text, *, samplerate=..., round_digits=...)textgrid_to_json_document(textgrid)json_document_to_textgrid(document)
Errors
UXTGErrorParseErrorSerializationErrorUnsupportedFormatErrorDomainValidationError
Supported Formats
| Format | Read | Write | Notes |
|---|---|---|---|
| Praat TextGrid | Yes | Yes | TextGrid, TextTier, IntervalTier |
| JSON document | Yes | Yes | Stable protocol via TextGridJsonDocument |
| HTK MLF | Yes | Partial | Stable MLF -> TextGrid; write emits TextGrid files |
Engineering
pytest+ coverage thresholdruffmypy- benchmark fixtures
- GitHub Actions CI for Python 3.10 / 3.11 / 3.12
Versioning
0.3.0 是一次破坏性升级版本。后续版本按 semver 演进。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
uxtg-0.3.0.tar.gz
(11.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
uxtg-0.3.0-py3-none-any.whl
(16.6 kB
view details)
File details
Details for the file uxtg-0.3.0.tar.gz.
File metadata
- Download URL: uxtg-0.3.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.3 Linux/6.17.0-19-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd96aa4cf15fd39be58829b388d3b4f298f054e7ba8e361bc48dc0915a3d07d
|
|
| MD5 |
625e3c24909a47777386e5537f43d7ee
|
|
| BLAKE2b-256 |
8667ee914ed42f42f9420b9f45faad24dbdc4f7dea4c6fa65f2375bd59bc2427
|
File details
Details for the file uxtg-0.3.0-py3-none-any.whl.
File metadata
- Download URL: uxtg-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.3 Linux/6.17.0-19-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb4ce5ee892771262d85a8a22ea1ea14c7a24b8846935f6e3cc9b8bf8456bc2
|
|
| MD5 |
645ccec28cc9a669e8fd0513093eb197
|
|
| BLAKE2b-256 |
6c6bf3d6b71b77f1fb2ade1a34aefaf9bd1249a0cdd549f62a02cd61290ef1a1
|