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 演进。
Metadata
Release files for uxtg 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uxtg-0.3.0.tar.gz | 11.6 kB | Without provenance | Details for uxtg-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uxtg-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for uxtg-0.3.0-py3-none-any.whl |
Total release size: 28.2 kB
Release files / uxtg-0.3.0.tar.gz
| Download URL | uxtg-0.3.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bd96aa4cf15fd39be58829b388d3b4f298f054e7ba8e361bc48dc0915a3d07d
|
|
BLAKE2b-256 checksum How to use checksums |
8667ee914ed42f42f9420b9f45faad24dbdc4f7dea4c6fa65f2375bd59bc2427
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.12.3 Linux/6.17.0-19-generic
|
Release files / uxtg-0.3.0-py3-none-any.whl
| Download URL | uxtg-0.3.0-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfb4ce5ee892771262d85a8a22ea1ea14c7a24b8846935f6e3cc9b8bf8456bc2
|
|
BLAKE2b-256 checksum How to use checksums |
6c6bf3d6b71b77f1fb2ade1a34aefaf9bd1249a0cdd549f62a02cd61290ef1a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.12.3 Linux/6.17.0-19-generic
|
Security for uxtg 0.3.0
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.