Registry / data / udtools

udtools

JSON →
library0.2.7pypypi✓ verified 84d ago

udtools (version 0.2.7) provides a suite of Python tools for working with Universal Dependencies (UD) data. It offers functionalities for reading, writing, querying, and transforming CoNLL-U files, as well as integrating with UDPipe. The library is actively maintained with an irregular release cadence, focusing on facilitating linguistic research and processing of dependency parsed text.

pip install udtools
INSTALL
IMPORT
SIG · UDTOOLS
U
udtools
datapythonv0.2.7
Install
2.7s avg
Import
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.7s · import 0.000s · 32MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Validator
from udtools import Validator
from udtools.conllu import CoNLLUDocument
data
from udtools import data
utils
from udtools import utils

This quickstart demonstrates how to create a CoNLLUDocument from a string, print its contents, apply a transformation, and add new sentences programmatically, showcasing basic data manipulation without file dependencies.

from udtools.conllu import CoNLLUDocument, Sentence, Token from udtools.transform import collapse_compounds # Create a sample CoNLL-U document from a string conllu_string = """ # sent_id = 1 # text = This is an example. 1 This this PRON DT Number=Sing|PronType=Dem 3 nsubj _ _ 2 is be AUX VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 3 cop _ _ 3 an a DET DT Definite=Ind|PronType=Art 4 det _ _ 4 example example NOUN NN Number=Sing 0 root _ SpaceAfter=No 5 . . PUNCT . _ 4 punct _ _ """ doc = CoNLLUDocument.from_string(conllu_string) print("Original document:") print(doc.to_string()) # Example transformation (collapse_compounds might not change this simple example) collapsed_doc = collapse_compounds(doc) print("\nDocument after collapse_compounds (no change for this simple example):") print(collapsed_doc.to_string()) # Demonstrate adding a new sentence new_sentence = Sentence() new_sentence.tokens.append(Token(id="1", form="Hello", lemma="hello", upos="INTJ")) new_sentence.tokens.append(Token(id="2", form=".", lemma=".", upos="PUNCT")) doc.sentences.append(new_sentence) print("\nDocument with a new sentence added:") print(doc.to_string())
Debug
Known issues
gotchaAs a pre-1.0 library (version 0.x.x), `udtools` API might not strictly adhere to semantic versioning. Minor releases could introduce breaking changes or significant modifications to existing functionalities.
fix
Always pin `udtools` to an exact version in production environments (e.g., `udtools==0.2.7`) and thoroughly test updates before deploying to ensure compatibility.
affects: <1.0.0
gotchaProcessing malformed CoNLL-U files can lead to `udtools.conllu.CoNLLUError` exceptions or silent data corruption. The library expects strict adherence to the CoNLL-U format.
fix
Ensure input CoNLL-U files are valid. Use online validators or implement pre-parsing checks before feeding data to `udtools`.
affects: all
gotchaLoading very large CoNLL-U documents entirely into memory using `CoNLLUDocument.from_file()` or `CoNLLUDocument.from_string()` can consume significant system RAM, potentially leading to `MemoryError`.
fix
For extremely large datasets, consider processing files sentence by sentence or using generator-based parsing if available, or break down large files into smaller chunks. The current API encourages loading entire documents, so external chunking is the primary workaround.
affects: all
Upgrade
Version history
0.2.7latest on PyPI · released Jan 8, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
udtools — pip install udtools · libregistry