{ "info": { "author": "Christopher Brown", "author_email": "chrisbrown@utexas.edu", "bugtrack_url": null, "classifiers": [], "description": "# `liwc`\n\n[![PyPI version](https://badge.fury.io/py/liwc.svg)](https://pypi.org/project/liwc/)\n[![Travis CI Build Status](https://travis-ci.org/chbrown/liwc-python.svg?branch=master)](https://travis-ci.org/chbrown/liwc-python)\n\nLinguistic Inquiry and Word Count (LIWC) analyzer.\n\nThe LIWC lexicon is proprietary, so it is _not_ included in this repository,\nbut this Python package requires it.\nThe lexicon data can be acquired (purchased) from [liwc.net](http://liwc.net/).\nThis package reads from the `LIWC2007_English100131.dic` (MD5: `2a8c06ee3748218aa89b975574b4e84d`) file,\nwhich must be available on any system where this package is used.\n\nThe LIWC2007 `.dic` format looks like this:\n\n %\n 1 funct\n 2 pronoun\n [...]\n %\n a 1 10\n abdomen* 146 147\n about 1 16 17\n [...]\n\n\n## Setup\n\nInstall from [PyPI](https://pypi.python.org/pypi/liwc):\n\n pip install -U liwc\n\n\n## Example\n\n```python\nimport re\nfrom collections import Counter\n\ndef tokenize(text):\n # you may want to use a smarter tokenizer\n for match in re.finditer(r'\\w+', text, re.UNICODE):\n yield match.group(0)\n\nimport liwc\nparse, category_names = liwc.load_token_parser('LIWC2007_English100131.dic')\n```\n\n* `parse` is a function from a token of text (a string) to a list of matching LIWC categories (a list of strings)\n* `category_names` is all LIWC categories in the lexicon (a list of strings)\n\n```python\ngettysburg = '''Four score and seven years ago our fathers brought forth on\n this continent a new nation, conceived in liberty, and dedicated to the\n proposition that all men are created equal. Now we are engaged in a great\n civil war, testing whether that nation, or any nation so conceived and so\n dedicated, can long endure. We are met on a great battlefield of that war.\n We have come to dedicate a portion of that field, as a final resting place\n for those who here gave their lives that that nation might live. It is\n altogether fitting and proper that we should do this.'''\ngettysburg_tokens = tokenize(gettysburg)\n# now flatmap over all the categories in all of the tokens using a generator:\ngettysburg_counts = Counter(category for token in gettysburg_tokens for category in parse(token))\n# and print the results:\nprint(gettysburg_counts)\n```\n\n\n## License\n\nCopyright (c) 2012-2018 Christopher Brown. [MIT Licensed](LICENSE.txt).\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chbrown/liwc-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "liwc", "package_url": "https://pypi.org/project/liwc/", "platform": "", "project_url": "https://pypi.org/project/liwc/", "project_urls": { "Homepage": "https://github.com/chbrown/liwc-python" }, "release_url": "https://pypi.org/project/liwc/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Linguistic Inquiry and Word Count (LIWC) analyzer (proprietary data not included)", "version": "0.4.1" }, "last_serial": 4339187, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "a79ca867b7e1f9df5b8efb87ba283642", "sha256": "a1be5f0208c5a8abf997533da003e9491e1eeffe9c4e5784ae2853089da2c3b5" }, "downloads": -1, "filename": "liwc-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a79ca867b7e1f9df5b8efb87ba283642", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5340, "upload_time": "2017-10-20T19:47:35", "url": "https://files.pythonhosted.org/packages/ab/d0/7f0a6160661c2345f317a2436e314fb06a7ea4b8c672e79579815fce0098/liwc-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0cd375df8c8a3606c565a052f8ad1304", "sha256": "0545e40fe5b793248615a722f3c5b0c0e4a81ed9e3163890b4fd474053b0e5a2" }, "downloads": -1, "filename": "liwc-0.3.0.tar.gz", "has_sig": false, "md5_digest": "0cd375df8c8a3606c565a052f8ad1304", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3114, "upload_time": "2017-10-20T19:47:36", "url": "https://files.pythonhosted.org/packages/39/ee/a7f3b682d8702a1c1a79c33cc52ca433310bfe03be8be0a506dfe86a160f/liwc-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "476cd3b084abde1f11c453aec9f29777", "sha256": "e8703d5c46b318d9eaf20ce7830ba9bb71aee1d36ea03028e01fe7c2e8003bf2" }, "downloads": -1, "filename": "liwc-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "476cd3b084abde1f11c453aec9f29777", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 3961, "upload_time": "2018-10-04T06:49:35", "url": "https://files.pythonhosted.org/packages/3e/e3/2fd35b8f4ef9053e13cd77bf55bbb196a0b2f0fd427158454b02c91d202b/liwc-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "66931fe3f3ae34377899fe38284b0f40", "sha256": "33434aafb6eaec49d28e05394bb86355543b294542d2ff3caf50241682b239ac" }, "downloads": -1, "filename": "liwc-0.4.0.tar.gz", "has_sig": false, "md5_digest": "66931fe3f3ae34377899fe38284b0f40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3458, "upload_time": "2018-10-04T06:49:33", "url": "https://files.pythonhosted.org/packages/77/e1/283b7a306196c77d4aa84943ac9ae5e837a5c11241c7b54485f04edb5d7b/liwc-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f900aeee4b46e879c080d8722a68c3c2", "sha256": "f1398991e5eb3c06d5bb3e9a01983bc83403867aa30b092dc53312e51c02525a" }, "downloads": -1, "filename": "liwc-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f900aeee4b46e879c080d8722a68c3c2", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 3955, "upload_time": "2018-10-04T06:54:20", "url": "https://files.pythonhosted.org/packages/a7/49/e8e94e8d542dbd5fefa067edd3125870d4d46d271e50d61b205b81fb4d9f/liwc-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "610b240d38c8b3c1838d4444e1407eae", "sha256": "c96416c7c55e741ad759b4c546004c6798638300475d0dc20fa82f1432076ff9" }, "downloads": -1, "filename": "liwc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "610b240d38c8b3c1838d4444e1407eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3451, "upload_time": "2018-10-04T06:54:18", "url": "https://files.pythonhosted.org/packages/0c/92/dc2a32bad9d9a3a6edfd7fe7610b92952155fb1e3abbb9ab5b9f7eb0aa1b/liwc-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f900aeee4b46e879c080d8722a68c3c2", "sha256": "f1398991e5eb3c06d5bb3e9a01983bc83403867aa30b092dc53312e51c02525a" }, "downloads": -1, "filename": "liwc-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f900aeee4b46e879c080d8722a68c3c2", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 3955, "upload_time": "2018-10-04T06:54:20", "url": "https://files.pythonhosted.org/packages/a7/49/e8e94e8d542dbd5fefa067edd3125870d4d46d271e50d61b205b81fb4d9f/liwc-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "610b240d38c8b3c1838d4444e1407eae", "sha256": "c96416c7c55e741ad759b4c546004c6798638300475d0dc20fa82f1432076ff9" }, "downloads": -1, "filename": "liwc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "610b240d38c8b3c1838d4444e1407eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3451, "upload_time": "2018-10-04T06:54:18", "url": "https://files.pythonhosted.org/packages/0c/92/dc2a32bad9d9a3a6edfd7fe7610b92952155fb1e3abbb9ab5b9f7eb0aa1b/liwc-0.4.1.tar.gz" } ] }