{ "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": "# liwc-analysis\nThis package serves as a driver for the LIWC2015 .txt dictionary. The dictionary is not included and can be purchased directly from LIWC.\n\n## Usage\nThe usage is fairly straight forward. First import the package\n```python\nimport liwcanalysis\n```\n\nThen you need to create an instance of the LIWC analysis with the path to the .txt file.\n```python\nLIWCLocation = \"/Users/Eric/repositories/transcript-analysis/LIWC/LIWC.2015.all.txt\"\nLIWC = liwcanalysis.liwc(LIWCLocation)\n```\n\nThen you can pass in a list of strings to analyze to receive a tuple of results dictionary and count dictionary.\n```python\ntranscripts = {\n \"Example1\": \"This is a single transcript. Red hat angry.\",\n \"Example2\": \"This is another single transcript. Dog boy cat.\",\n}\n\nstr_list = []\nfor key in transcripts:\n str_list.append(transcripts[key])\n\nresult_dics, count_dics = LIWC.analyze(str_list)\n```\n\nPlease note that `analyze()` can take either a single string argument or a list of strings. Example:\n```python\n# this is valid\nresult_dics, coutn_dics = LIWC.analyze([\"this is a string\", \"here is another\", \"one more\"])\n# this is also valid\nresult_dics, coutn_dics = LIWC.analyze(\"this is a string\")\n```\n\n`result_dics` is a list of dictionaries. Each dictionary corresponds to one of the strings passed into `analyze`. Each dictionary follows the form of `\"LIWC Category\": [list, of, words, matched]`. For instance the dictionary for one string might look something like:\n```\n{\n \"FUNCTION\": [\"is\", \"a\"],\n \"QUANT\": [\"single\"],\n ...\n}\n```\n\n`count_dics` is very similar to `result_dics`, but instead of giving a list of words matched, it gives the length of each list of words matched:\n```\n{\n \"FUNCTION\": 2,\n \"QUANT\": 1,\n ...\n}\n```\n\nFinally, you can print out the results to csv using:\n```python\nLIWC.print(output_dir, titles)\n```\nYou need to specify the output directory, as well as a list of titles for each string. See the full example for more details.\n\nYou can also retrieve an alphabetically sorted (A->Z) list of LIWC categories using `LIWC.get_categories()`.\n\n## Full Example\n```python\nimport liwcanalysis\n\ntranscripts = {\n \"Example1\": \"This is a single transcript. Red hat angry.\",\n \"Example2\": \"This is another single transcript. Dog boy cat.\",\n}\n\nstr_list = []\nfor key in transcripts:\n strs.append(transcripts[key])\n\nLIWCLocation = \"/Users/Downloads/LIWC/LIWC.2015.all.txt\"\noutput_dir = \"/Path/to/my/file/\"\n\nLIWC = liwcanalysis.liwc(LIWCLocation)\nresult_dics, count_dics = LIWC.analyze(str_list)\nLIWC.print(output_dir, list(transcript.keys()))\n```\nUsing print will return the following tables:\n/Path/to/my/file/LIWCcounts.csv:\n\n| Category | Example1 | Example2 |\n|---------------|----------|----------|\n| ADJ | 1 | 1 |\n| ARTICLE | 1 | |\n| AUXVERB | 1 | 1 |\n| FOCUSPRESENT | 1 | 1 |\n| FUNCTION | 2 | 2 |\n| IPRON | | 1 |\n| MALE | | 1 |\n| NUMBER | 1 | 1 |\n| PRONOUN | | 1 |\n| QUANT | 1 | 2 |\n| SOCIAL | | 1 |\n| VERB | 1 | 1 |\n| WORK | 1 | 1 |\n| TOTAL | 8 | 8 |\n\n/Path/to/my/file/LIWCwords.csv:\n\n| Category | Example1 | Example2 |\n|---------------|-----------------|-----------------------|\n| ADJ | ['single'] | ['single'] |\n| ARTICLE | ['a'] | |\n| AUXVERB | ['is'] | ['is'] |\n| FOCUSPRESENT | ['is'] | ['is'] |\n| FUNCTION | ['is', 'a'] | ['is', 'another'] |\n| IPRON | | ['another'] |\n| MALE | | ['boy'] |\n| NUMBER | ['single'] | ['single'] |\n| PRONOUN | | ['another'] |\n| QUANT | ['single'] | ['another', 'single'] |\n| SOCIAL | | ['boy'] |\n| VERB | ['is'] | ['is'] |\n| WORK | ['transcript.'] | ['transcript.'] |\n\n/Path/to/my/file/LIWCrelativefreq.csv\n\n| Category | Example1 | Example2 |\n|---------------|----------|----------|\n| ADJ | 0.125 | 0.125 |\n| ARTICLE | 0.125 | |\n| AUXVERB | 0.125 | 0.125 |\n| FOCUSPRESENT | 0.125 | 0.125 |\n| FUNCTION | 0.25 | 0.25 |\n| IPRON | | 0.125 |\n| MALE | | 0.125 |\n| NUMBER | 0.125 | 0.125 |\n| PRONOUN | | 0.125 |\n| QUANT | 0.125 | 0.25 |\n| SOCIAL | | 0.125 |\n| VERB | 0.125 | 0.125 |\n| WORK | 0.125 | 0.125 |\n\nPlease let me know if you have any questions or features requests. Please feel free to open up a pull request, issue, or shoot me an email at ericwiener3@gmail.com.\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/liwc-analysis", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "liwc-analysis", "package_url": "https://pypi.org/project/liwc-analysis/", "platform": "", "project_url": "https://pypi.org/project/liwc-analysis/", "project_urls": { "Homepage": "https://github.com/EricWiener/liwc-analysis" }, "release_url": "https://pypi.org/project/liwc-analysis/1.2.4/", "requires_dist": [ "pandas" ], "requires_python": "", "summary": "Driver for LIWC2015 analysis. LIWC2015 dictionary not included.", "version": "1.2.4" }, "last_serial": 4951317, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "3b22fee6ffa47bbaa50f3b0e7d72d166", "sha256": "1544012b5f0eb9a4a66f4cce26658e5ecf79db2e97eaecca55ca72c526bfceab" }, "downloads": -1, "filename": "liwc_analysis-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3b22fee6ffa47bbaa50f3b0e7d72d166", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5130, "upload_time": "2019-03-10T15:57:30", "url": "https://files.pythonhosted.org/packages/bf/16/2c8839032834bedd7d36b900909ca5ff131a8a739073f664251db8dae663/liwc_analysis-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d3240c92c61db6db1d19770ef7e0cf8b", "sha256": "8a4a0964b4e557619f158ccfdb3eaf85317bcc6edb6ec2310526c92fbcb25667" }, "downloads": -1, "filename": "liwc-analysis-1.2.0.tar.gz", "has_sig": false, "md5_digest": "d3240c92c61db6db1d19770ef7e0cf8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4099, "upload_time": "2019-03-10T15:57:31", "url": "https://files.pythonhosted.org/packages/5d/f2/3ff6ca092b8bee54bcd8101caf0b829ca68a683ffb4dbc3c48b0db213b84/liwc-analysis-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "e361f9285f33b67b67f4cd683211d800", "sha256": "d7759c1f0a2a069ca9599412b02d31394b0fab9c93993e297235e0d80cc1f017" }, "downloads": -1, "filename": "liwc_analysis-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e361f9285f33b67b67f4cd683211d800", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5748, "upload_time": "2019-03-17T19:14:22", "url": "https://files.pythonhosted.org/packages/70/3c/e4cb6e8d244c95f1c1f2566f4d3b1e99860afd72635b5cb8995d9c56a3a2/liwc_analysis-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4808cedf16f67c3436e5bf4d57d2ac5c", "sha256": "d93b41171c7d753b6d12804a64c57876701a9819298a9ced3667c520aa17d44b" }, "downloads": -1, "filename": "liwc-analysis-1.2.1.tar.gz", "has_sig": false, "md5_digest": "4808cedf16f67c3436e5bf4d57d2ac5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4744, "upload_time": "2019-03-17T19:14:23", "url": "https://files.pythonhosted.org/packages/3e/85/1c158bbe89c214819ceea34bf3a4e7a53dc1707516a4c760aa57ee04a347/liwc-analysis-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "fd670b807e0663fb65e528667505b203", "sha256": "8a00fbf2fbf4fff587ef5f4ea15f2226a864d198399829a02fd600b29af052f3" }, "downloads": -1, "filename": "liwc_analysis-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fd670b807e0663fb65e528667505b203", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5515, "upload_time": "2019-03-17T19:32:13", "url": "https://files.pythonhosted.org/packages/7f/b0/115e2b7bb0c6e9a2072b496a11e58b1c520cd15732030455d3537fe03824/liwc_analysis-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a33be825c123c97b468e81cfe563d246", "sha256": "a97403b2961e7925e044d9ccb559579006677b1cff32db601bad6bddbe353c3c" }, "downloads": -1, "filename": "liwc-analysis-1.2.2.tar.gz", "has_sig": false, "md5_digest": "a33be825c123c97b468e81cfe563d246", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4509, "upload_time": "2019-03-17T19:32:16", "url": "https://files.pythonhosted.org/packages/f6/a1/62c441fa7f5ca136791702df3f8b02d95ce5cd9f894ae1a6306408383979/liwc-analysis-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "14c9903db547efd2b42ee8812bb5386c", "sha256": "a283584d4e7ce3e649339c731e82cbef7acf1e3ecc9960a91ae935854c511da2" }, "downloads": -1, "filename": "liwc_analysis-1.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "14c9903db547efd2b42ee8812bb5386c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5514, "upload_time": "2019-03-17T19:35:22", "url": "https://files.pythonhosted.org/packages/e9/ed/32328a9e33499877f36bfe3fc095d8160146befd107cff5942175b5fb08e/liwc_analysis-1.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d85b9677e1e81cb0830405828b93665", "sha256": "9f8c2f324890e3e7440412291f86e4b60b489de439f47ee3211c1c31fc9d0382" }, "downloads": -1, "filename": "liwc-analysis-1.2.3.tar.gz", "has_sig": false, "md5_digest": "2d85b9677e1e81cb0830405828b93665", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4506, "upload_time": "2019-03-17T19:35:26", "url": "https://files.pythonhosted.org/packages/6a/74/bfea7b61b200390060543ed7cd31c19a4cde465fa72593174c251668e1b0/liwc-analysis-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "e763798a9b87e73c83f1199265ad2f2b", "sha256": "ec942be71f27f795c8ed2b381e81c77c645158545da46348d17df4c3a5e299a9" }, "downloads": -1, "filename": "liwc_analysis-1.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e763798a9b87e73c83f1199265ad2f2b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5520, "upload_time": "2019-03-17T20:18:04", "url": "https://files.pythonhosted.org/packages/eb/b5/bce45c2c5fe37a3e1a49fa2bd06f4971a890e30d07833891084c0bf96401/liwc_analysis-1.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48166449e59e7d1fbd196dfe5943b2b6", "sha256": "22e336a266e5f1051f39e26b1b355c1d19fe4e6ffa1f087bbc2d70b14d2c261f" }, "downloads": -1, "filename": "liwc-analysis-1.2.4.tar.gz", "has_sig": false, "md5_digest": "48166449e59e7d1fbd196dfe5943b2b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4505, "upload_time": "2019-03-17T20:18:08", "url": "https://files.pythonhosted.org/packages/05/b1/1f367c0af8d04cc3f21324638ed0835187e19405058974084601d93c9866/liwc-analysis-1.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e763798a9b87e73c83f1199265ad2f2b", "sha256": "ec942be71f27f795c8ed2b381e81c77c645158545da46348d17df4c3a5e299a9" }, "downloads": -1, "filename": "liwc_analysis-1.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e763798a9b87e73c83f1199265ad2f2b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5520, "upload_time": "2019-03-17T20:18:04", "url": "https://files.pythonhosted.org/packages/eb/b5/bce45c2c5fe37a3e1a49fa2bd06f4971a890e30d07833891084c0bf96401/liwc_analysis-1.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48166449e59e7d1fbd196dfe5943b2b6", "sha256": "22e336a266e5f1051f39e26b1b355c1d19fe4e6ffa1f087bbc2d70b14d2c261f" }, "downloads": -1, "filename": "liwc-analysis-1.2.4.tar.gz", "has_sig": false, "md5_digest": "48166449e59e7d1fbd196dfe5943b2b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4505, "upload_time": "2019-03-17T20:18:08", "url": "https://files.pythonhosted.org/packages/05/b1/1f367c0af8d04cc3f21324638ed0835187e19405058974084601d93c9866/liwc-analysis-1.2.4.tar.gz" } ] }