{"id":5885,"library":"conllu","title":"CoNLL-U Parser","description":"The `conllu` library (version 6.0.0) is a Python parser for the CoNLL-U format, converting CoNLL-U formatted strings into a nested Python dictionary structure. CoNLL-U is frequently used as an output format for natural language processing tasks. It is actively maintained with a moderate release cadence and has no external dependencies.","status":"active","version":"6.0.0","language":"en","source_language":"en","source_url":"https://github.com/EmilStenstrom/conllu/","tags":["NLP","CoNLL-U","parser","natural language processing","linguistics"],"install":[{"cmd":"pip install conllu","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"parse","correct":"from conllu import parse"},{"symbol":"parse_tree","correct":"from conllu import parse_tree"}],"quickstart":{"code":"from conllu import parse\n\ndata = \"\"\"\n# text = The quick brown fox jumps over the lazy dog.\n1\tThe\tthe\tDET\tDT\tDefinite=Def|PronType=Art\t4\tdet\t_\t_\n2\tquick\tquick\tADJ\tJJ\tDegree=Pos\t4\tamod\t_\t_\n3\tbrown\tbrown\tADJ\tJJ\tDegree=Pos\t4\tamod\t_\t_\n4\tfox\tfox\tNOUN\tNN\tNumber=Sing\t5\tnsubj\t_\t_\n5\tjumps\tjump\tVERB\tVBZ\tMood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin\t0\troot\t_\t_\n6\tover\tover\tADP\tIN\t_\t9\tcase\t_\t_\n7\tthe\tthe\tDET\tDT\tDefinite=Def|PronType=Art\t9\tdet\t_\t_\n8\tlazy\tlazy\tADJ\tJJ\tDegree=Pos\t9\tamod\t_\t_\n9\tdog\tdog\tNOUN\tNN\tNumber=Sing\t5\tnmod\t_\tSpaceAfter=No\n10\t.\t.\tPUNCT\t.\t_\t5\tpunct\t_\t_\n\"\"\"\n\nsentences = parse(data)\n\n# Accessing tokens and metadata\nsentence = sentences[0]\nprint(f\"Sentence text: {sentence.metadata.get('text')}\")\nfor token in sentence:\n    print(f\"ID: {token['id']}, Form: {token['form']}, UPos: {token['upos']}\")\n","lang":"python","description":"Parses a CoNLL-U formatted string into a list of `TokenList` objects, each representing a sentence. Tokens can be accessed as dictionary-like objects, and sentence metadata is available via the `.metadata` attribute."},"warnings":[{"fix":"Upgrade to Python 3.8+ or pin `conllu<5.0.0`.","message":"Version 5.0 (and newer, including 6.0.0) requires Python 3.8 or higher. Projects running on Python 3.6 or 3.7 must upgrade their Python version or pin `conllu` to a version older than 5.0.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Update token field access from `token['xpostag']` to `token['xpos']` and `token['upostag']` to `token['upos']`.","message":"In version 3.0, the field names `xpostag` and `upostag` were changed to `xpos` and `upos` respectively, to align with Universal Dependencies 2.0. While `conllu` provides aliasing for backward compatibility, it's recommended to update code to use `xpos` and `upos` for clarity and future compatibility.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Review the official migration guides for versions 0.1 to 1.0 on the PyPI project page or GitHub repository for detailed code changes required.","message":"Updating from very old versions (e.g., 0.1 to 1.0) involved significant breaking changes to the API. Users migrating from such old versions should consult the release notes for a comprehensive upgrade guide.","severity":"breaking","affected_versions":"0.1.x to 1.x.x"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}