{ "info": { "author": "Eric Wiener", "author_email": "ericwiener3@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Readability Metrics\nThis project is based extremely heavily on [mmautner's package](https://github.com/mmautner/readability). Modifications were made to support the analysis of large documents.\n\n## Inspiration\nWhen using mmautner's package, the entire document needed to be passed in at once:\n```python\nlarge_str = \"....\"\nrd = Readability(large_str)\nprint('ARI: ', rd.ARI())\n```\n\nHowever, while doing an analysis of Supreme Court transcripts since 1956 across various metrics, my personal computer was not able to load and the needed documents all at once. In order to account for this, I created this package, which allows for pieces of documents to be passed in. Furthermore, the text is not stored, only the resulting calculations. Lastly, all metrics are calculated and returned each time, so individual calculations don't need to be performed.\n\n## Installation\nReadability metrics can be installed from PyPi:\n```\n$ pip3 install readability-metrics\n```\n\n## Usage\nReadability metrics can be used as follows:\n\n```python\nimport metrics # import package\n\nrdm = Readability()\nrdm.analyze_text(\"This is a sentence.\")\nrdm.analyze_text(\"This is part of the same document.\")\nrdm.analyze_text(\"This is also part of the same document.\")\nrdm.get_results()\n\n# can further modify\nrdm.analyze_text(\"This is also part of the same document.\")\nrdm.get_results()\n\n# can clear and start new analysis\nrdm.clear()\nrdm.analyze_text(\"This is also part of the same document.\")\nrdm.get_results()\n```\n\nYou can also calculate readability metrics across multiple categories. For instance, if you had a transcript, you could calculate metrics for all speakers at once:\n\n```python\nimport metrics\nfrom collections import defaultdict\n\nlet transcript = [\n ('John George', 'Words said by John George'),\n ('Apple Dunkin', 'Words said by Apple Dunkin'),\n # ...\n]\n\nreadability_per_speaker = defaultdict(lambda: Readability())\n\n# Calculate readability metrics\nfor dialogue in transcript:\n readability_per_speaker[dialogue[0]].analyze_text(dialogue[1])\n\n# Calculate results\nfor speaker in readability_per_speaker:\n dic[key] = dic[key].get_results()\n\n# readability_per_speaker now in form:\n{\n \"SPEAKER NAME\": {\n {\n 'ARI': 12.163787878787879,\n 'FleschReadingEase': 58.2319, 'FleschKincaidGradeLevel': 11.2857,\n 'GunningFogIndex': 14.5465,\n 'SMOGIndex': 12.287087810503355,\n 'ColemanLiauIndex': 9.5226,\n 'LIX': 46.467171717171716,\n 'RIX': 5.375\n }\n },\n # more speakers ...\n}\n```\n\n## Contribution\nContributions are welcome. Please create a pull request or email me at ericwiener3@gmail.com. Also feel free to create an issue if you need help with something.\n\n## Testing\nTesting can be run with pytest. Simple navigate to the directory and run `pytest`.\n\n\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/EricWiener/readability-metrics", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "readability-metrics", "package_url": "https://pypi.org/project/readability-metrics/", "platform": "", "project_url": "https://pypi.org/project/readability-metrics/", "project_urls": { "Homepage": "https://github.com/EricWiener/readability-metrics" }, "release_url": "https://pypi.org/project/readability-metrics/1.0.0/", "requires_dist": [ "nltk" ], "requires_python": "", "summary": "Calculates multiple readability metrics for large documents.", "version": "1.0.0" }, "last_serial": 5139406, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "359ca088c07f2d1279ba97aca7e53115", "sha256": "a835b2a445413866368ea3170de230eccf170e88757d069486a07239c050a9e7" }, "downloads": -1, "filename": "readability_metrics-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "359ca088c07f2d1279ba97aca7e53115", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7787, "upload_time": "2019-04-13T22:48:21", "url": "https://files.pythonhosted.org/packages/73/b3/bc1de4f28ef881c0bda159170f54ca4514a05c6d7bc03ca06cb178a73c81/readability_metrics-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3646206b8bf454e699c8892c3497c91", "sha256": "dc1af25268c167c3563a3ce3d85c6e761b48b72f12e519b829098607992ff9de" }, "downloads": -1, "filename": "readability-metrics-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c3646206b8bf454e699c8892c3497c91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6108, "upload_time": "2019-04-13T22:48:23", "url": "https://files.pythonhosted.org/packages/af/82/9f259e1a0fc62e7e9b19dfbd5f77c07f71ffe28a272ef95f09ded84e3a94/readability-metrics-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "359ca088c07f2d1279ba97aca7e53115", "sha256": "a835b2a445413866368ea3170de230eccf170e88757d069486a07239c050a9e7" }, "downloads": -1, "filename": "readability_metrics-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "359ca088c07f2d1279ba97aca7e53115", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7787, "upload_time": "2019-04-13T22:48:21", "url": "https://files.pythonhosted.org/packages/73/b3/bc1de4f28ef881c0bda159170f54ca4514a05c6d7bc03ca06cb178a73c81/readability_metrics-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3646206b8bf454e699c8892c3497c91", "sha256": "dc1af25268c167c3563a3ce3d85c6e761b48b72f12e519b829098607992ff9de" }, "downloads": -1, "filename": "readability-metrics-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c3646206b8bf454e699c8892c3497c91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6108, "upload_time": "2019-04-13T22:48:23", "url": "https://files.pythonhosted.org/packages/af/82/9f259e1a0fc62e7e9b19dfbd5f77c07f71ffe28a272ef95f09ded84e3a94/readability-metrics-1.0.0.tar.gz" } ] }