{ "info": { "author": "Sheean Spoel (Digital Humanities Lab, Utrecht University)", "author_email": "s.j.j.spoel@uu.nl", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/UUDigitalHumanitieslab/tei_reader.svg?branch=master)](https://travis-ci.org/UUDigitalHumanitieslab/tei_reader)\n\n# Python 3 Library for Reading the Text Content and Metadata of TEI P5 (Lite) Files\n\nThe library focuses on extracting the main text content from a file and provide the available metadata about the text.\n\n# TL;DR\n\n```bash\npip install tei-reader\n```\n\n```python\nfrom tei_reader import TeiReader\nreader = TeiReader()\ncorpora = reader.read_file('example-tei.xml') # or read_string\nprint(corpora.text)\n\n# show element attributes before the actual element text\nprint(corpora.tostring(lambda x, text: str(list(a.key + '=' + a.text for a in x.attributes)) + text))\n```\n\n# More Explanation\nA reader can be opened using `TeiReader()`. It is then possible to either call `read_file(file_name)` or `read_string(str)`. Both will return a `Corpora` object containing the following properties:\n\n| Property | Description |\n| --- | --- |\n| `corpora[]` | A corpora can contain sub-corpora. |\n| `documents[]` | The `Document` objects directly part of this corpora. |\n\n`Corpora` and `Document` all inherit from `Element`. In all objects deriving from this it is possible to call:\n\n| Property | Description\n| --- | --- |\n| `attributes{}` | Contain attributes applicable to this element. If an attribute contains attributes these are also returned. (e.g. `encodingDesc::editorialDecl::normalization`) |\n| `text` | Get the entire text content as `str` |\n| `divisions[]` | Recursively get all the text divisions in document order. If an element contains parts or text without tag. Those will be returned in order and wrapped with a `PlaceholderDivision`. |\n| `parts[]` | Recursively get the parts in document order constituting the entire text e.g. if something has emphasis, a footnote or is marked as foreign. Text without a container element will be returned in order and wrapped with a `PlaceholderPart`. |\n\n`Attribute`, `PlaceholderDivision` and `PlaceholderPart` all support the same properties as `Element`.\n\n# Upload to PyPi\n\n```bash\npython setup.py sdist\ntwine upload dist/*\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/UUDigitalHumanitieslab/tei_reader", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tei-reader", "package_url": "https://pypi.org/project/tei-reader/", "platform": "", "project_url": "https://pypi.org/project/tei-reader/", "project_urls": { "Homepage": "https://github.com/UUDigitalHumanitieslab/tei_reader" }, "release_url": "https://pypi.org/project/tei-reader/0.0.17/", "requires_dist": null, "requires_python": ">=3.5, <4", "summary": "TEI Reader", "version": "0.0.17" }, "last_serial": 5440657, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "1277532c613429ddbd9ad80fbc592dff", "sha256": "bb06c70121466acc5cdd650f37913f19e54b1c5cbe68a98690a054d9a70c53e9" }, "downloads": -1, "filename": "tei_reader-0.0.10.tar.gz", "has_sig": false, "md5_digest": "1277532c613429ddbd9ad80fbc592dff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5832, "upload_time": "2018-03-06T15:57:35", "url": "https://files.pythonhosted.org/packages/20/17/0250d46e3497321b0ae40ec1435cab7202fedc4a49137df3a2764803069d/tei_reader-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "0f80ed38a2fd723676848958326a25c9", "sha256": "ea333792965cd58f34c3eb7b5c44bd1f7280d767d850e9a28368a6cd207546ea" }, "downloads": -1, "filename": "tei_reader-0.0.11.tar.gz", "has_sig": false, "md5_digest": "0f80ed38a2fd723676848958326a25c9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5848, "upload_time": "2018-03-20T10:07:33", "url": "https://files.pythonhosted.org/packages/30/e5/a1a8961063a52dcd1beeac93e20a9daab745f15ee9e7bad7f11f3bb06264/tei_reader-0.0.11.tar.gz" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "3b45fb22b65a5a9289cac26f28b6a87b", "sha256": "e3e8204a4a9f869a372393eca11c3e891c905ae44f27ee59117db4a85f3f2e0c" }, "downloads": -1, "filename": "tei_reader-0.0.12.tar.gz", "has_sig": false, "md5_digest": "3b45fb22b65a5a9289cac26f28b6a87b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5954, "upload_time": "2018-03-20T11:04:14", "url": "https://files.pythonhosted.org/packages/74/82/53124330d2294e441001c9d4d82a72d593457377e081732f9cfccef38597/tei_reader-0.0.12.tar.gz" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "91c8ec440c5d65c7d8c2cd19b3b137e7", "sha256": "e90d3f3b273175da2ebb796fca3ab12e784a6f0086add43b0eba0319b8ed00c0" }, "downloads": -1, "filename": "tei_reader-0.0.13.tar.gz", "has_sig": false, "md5_digest": "91c8ec440c5d65c7d8c2cd19b3b137e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 6968, "upload_time": "2018-08-10T15:17:04", "url": "https://files.pythonhosted.org/packages/9a/04/ba47cbfb9b9fb914f5cc98704d68b4957723c626fbd53fc48a5d1918680d/tei_reader-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "4679194a1814566008300ca8b60a4362", "sha256": "3f3c2aaa9bd597c81415b48a8ad7fe53447efa6c014850e848f7c385f350d936" }, "downloads": -1, "filename": "tei_reader-0.0.14.tar.gz", "has_sig": false, "md5_digest": "4679194a1814566008300ca8b60a4362", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 6978, "upload_time": "2018-08-13T09:13:20", "url": "https://files.pythonhosted.org/packages/ef/e2/737097d4cc3f967ddbad07185ce1e3a9aa09bf5d8f1a0d620e22ccd670d6/tei_reader-0.0.14.tar.gz" } ], "0.0.15": [ { "comment_text": "", "digests": { "md5": "46d0369865e2814b5a8c8fee1396f068", "sha256": "9d399992bacc605c30dac76b430ca5c1e5747074f2f7b5c1caa562bfc6696287" }, "downloads": -1, "filename": "tei_reader-0.0.15.tar.gz", "has_sig": false, "md5_digest": "46d0369865e2814b5a8c8fee1396f068", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 7106, "upload_time": "2018-08-13T15:21:07", "url": "https://files.pythonhosted.org/packages/9c/98/eeceabab2602203f2dd0ee7d315f27a36af2f8c2e2e55556286fd6b5affb/tei_reader-0.0.15.tar.gz" } ], "0.0.16": [ { "comment_text": "", "digests": { "md5": "2fda9024900bad57aea22c75a4901da1", "sha256": "14ab5746524315ee00b77a2ce94629744b7bd7c7d4eaef840a6ee3c5ef3ad67e" }, "downloads": -1, "filename": "tei_reader-0.0.16.tar.gz", "has_sig": false, "md5_digest": "2fda9024900bad57aea22c75a4901da1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 7099, "upload_time": "2018-08-13T15:31:07", "url": "https://files.pythonhosted.org/packages/42/c1/10ca0b5f5d931850cfdacd041f512e513374755bd81007b6dd4be2136b2d/tei_reader-0.0.16.tar.gz" } ], "0.0.17": [ { "comment_text": "", "digests": { "md5": "f322e3e8ba8235d0a51811f4a96ab636", "sha256": "7db9809dc405518fda3f33e2024fec4c663c1cb6b27a8fbaa0cd0b5cf7f943ae" }, "downloads": -1, "filename": "tei_reader-0.0.17.tar.gz", "has_sig": false, "md5_digest": "f322e3e8ba8235d0a51811f4a96ab636", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5, <4", "size": 7089, "upload_time": "2019-06-24T13:36:55", "url": "https://files.pythonhosted.org/packages/63/16/e7127bec394bd1112379ab8ff458f7d0d10f7336e2b7b2396de9931da024/tei_reader-0.0.17.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "12e87649ada9fc8e3ac51164b7f9be83", "sha256": "9c2e0449376e50e5f0df7e0b05ff2f195d1f6360187fc957f6bdc2a37b299a8b" }, "downloads": -1, "filename": "tei_reader-0.0.7.tar.gz", "has_sig": false, "md5_digest": "12e87649ada9fc8e3ac51164b7f9be83", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5796, "upload_time": "2018-02-27T09:23:01", "url": "https://files.pythonhosted.org/packages/5b/d0/2ede98037829885cff9b2a85df748d1b97b4798c2ef24858177fcecca223/tei_reader-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "19d1814b7b8516cee4a2a52893eb97dc", "sha256": "bc0dd6784225b592dd76a1792eefc756a0cc9152d623af35c0c0736f38ced59c" }, "downloads": -1, "filename": "tei_reader-0.0.8.tar.gz", "has_sig": false, "md5_digest": "19d1814b7b8516cee4a2a52893eb97dc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5804, "upload_time": "2018-03-05T14:34:41", "url": "https://files.pythonhosted.org/packages/4a/79/b6534db9abb3bf82e6a654d531da2a52d8aab7b82e4dd037f7042d87e491/tei_reader-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "013e9594b6a308912b4713702762922a", "sha256": "aecff0b9a96d166158dd084b7add496922e5893567dc548ea16090d9845cf161" }, "downloads": -1, "filename": "tei_reader-0.0.9.tar.gz", "has_sig": false, "md5_digest": "013e9594b6a308912b4713702762922a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 5826, "upload_time": "2018-03-06T11:51:17", "url": "https://files.pythonhosted.org/packages/1a/cd/ab76ba1b49f64575a0c1c87eed991a6371158974a23f807c92e9e955a2ce/tei_reader-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f322e3e8ba8235d0a51811f4a96ab636", "sha256": "7db9809dc405518fda3f33e2024fec4c663c1cb6b27a8fbaa0cd0b5cf7f943ae" }, "downloads": -1, "filename": "tei_reader-0.0.17.tar.gz", "has_sig": false, "md5_digest": "f322e3e8ba8235d0a51811f4a96ab636", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5, <4", "size": 7089, "upload_time": "2019-06-24T13:36:55", "url": "https://files.pythonhosted.org/packages/63/16/e7127bec394bd1112379ab8ff458f7d0d10f7336e2b7b2396de9931da024/tei_reader-0.0.17.tar.gz" } ] }