{ "info": { "author": "Aron Culotta", "author_email": "aronwc@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "purpletag\n=========\n\nA tool to track polarized hashtags used by members of the U.S. congress.\n\nInstall\n-------\n\n``pip install purpletag``\n\nor, from source:\n\n::\n\n git clone https://github.com/casmlab/purpletag.git\n cd purpletag\n python setup.py install\n\nConfiguration\n-------------\n\npurpletag depends on `twutil `__ for\ncollecting data from Twitter. You'll need to put your credentials in the\nfollowing environmental variables:\n\n- ``TW_CONSUMER_KEY``\n- ``TW_CONSUMER_SECRET``\n- ``TW_ACCESS_TOKEN``\n- ``TW_ACCESS_TOKEN_SECRET``\n\npurpletag also depends on a configuration file (see\n```sample.cfg`` `__ for an example). By default, it is\nassumed to be in ``~/.purpletag``, but you can specify a custom location\nby setting the ``PURPLE_CFG`` environmental variable.\n\nBy default, all data will be written to ``/data/purpletag``, but you can\nchange this in the config file.\n\npurpletag fetches the list of legislators and their Twitter handles from\nhttp://www.govtrack.us/; these URLs are also specified in the config.\n\nGetting started\n---------------\n\npurpletag consists of a number of command-line tools to collect, parse,\nand analyze tweets sent by members of Congress.\n\nTo see the list of commands:\n\n::\n\n $ purpletag -h\n usage: purpletag [--help] [...]\n\n The most commonly used purpletag commands are:\n collect Collect tweets from members of congress, stored in json\n parse Parse tweet json\n score Create score files containing polarization scores for hashtags and MOCs.\n serve Launch a web service to visualize results.\n See 'purpletag help ' for more information on a specific command.\n\nThe expected use case is that ``collect`` is run continuously, then\n``parse``, ``score``, ``serve`` are run once daily. There is also\nsupport for using historical data (see the ``-s`` option of ``collect``\nand the ``-d`` option of ``parse``).\n\n``collect``\n~~~~~~~~~~~\n\nThis command will fetch tweets from all members of congress listed in\n``twitter.yaml``.\n\n::\n\n purpletag collect -h\n usage:\n purpletag collect [options]\n purpletag collect (-t | --track | -s | --search) [options]\n\n Options\n -h, --help\n -o, --output output path\n -r, --refresh-handles fetch latest twitter handles for politicians\n -t, --track collect tweets in real time using streaming API\n -s, --search search historical tweets using search API\n\nThere are two modes of operation:\n\n- ``track``: Use the Twitter Streaming API to collect tweets in\n real-time.\n- ``search``: Use the Twitter REST API to collect the most recent 3,200\n tweets from each legislator.\n\nOutput is stored in ``/data/purpletag/jsons``.\n\nYou probably want to use ``search`` to first collect all historical\ntweets, then run ``track`` to collect all tweets going forward.\n**Note:** ``search`` will take a long time to run (hours), since the\nscript sleeps to wait out the rate limits imposed by the REST API.\n\n``parse``\n~~~~~~~~~\n\nThis command will parse all the collected tweets in\n``/data/purpletag/jsons`` and extract the hashtags used by each\nlegislator.\n\n::\n\n purpletag parse -h\n usage: purpletag parse [options]\n\n Parse .json files into .tags files.\n\n Options\n -h, --help help\n -t sliding window timespans [default: 1,7,30]\n -d number of historical days to simulate [default: 1]\n\nThe output looks like this:\n\n::\n\n markwarner whistleblowers:1 studentdebt:1 nova:1 f22:1\n repwestmoreland jobs:1 nationaldayofprayer:2 benghazi:3\n\nFor example, this indicates that Lynn Westmoreland used the hashtag\n#jobs once, #nationaldayofprayer twice, and #benghazi three times.\n\nThe ``-t`` parameter indicates a list of timespans to use when\naggregating these statistics. For example ``purpletag parse -t 30`` will\nparse all tweets posted in the past 30 days and compute output like the\nexample above. The file name itself will indicate this. For example,\n``2014-05-02.30.tags`` is a tags file created when running this command\non May 2, 2014, collecting statistics for the past 30 days.\n\nThe ``-d`` parameter allows you to simulate running this for a number of\ndays in the past. This is useful after running ``purpletag collect -s``\nto collect all historical data (up to 3,200 per legislator), then\ngenerating tags files as if you had been running this daily.\n\nOutput is stored in ``/data/purpletag/tags``.\n\n``score``\n~~~~~~~~~\n\nThis command scores hashtags according to their polarity.\n\n::\n\n purpletag score -h\n usage: purpletag score [options]\n\n Compute polarity scores for all .tags files that we haven't yet processed.\n\n Options\n -h, --help help\n -r, --refresh-mocs fetch latest legislator information from GovTrack\n -c, --counts use hashtag count features instead of binary features\n -o, --overwrite overwrite existing .scores files\n\nThese produce ``.scores`` files, one per ``.tags`` file. E.g.,\n``2014-05-02.365.scores`` contains the scores for the hashtags used for\nthe 365 days prior to May 2, 2014. The scores range from -1 (liberal) to\n+1 (conservative).\n\n::\n\n demandavote -0.004258\n getcovered -0.003548\n raisethewage -0.003548\n .\n .\n .\n senatemustact 0.001499\n fairnessforall 0.001799\n tcot 0.002249\n\nOutput is stored in ``/data/purpletag/scores``.\n\n``serve``\n~~~~~~~~~\n\nThis command will launch a simple web server to visualize tag polarity\nover time, using ```dygraphs`` `__\n\n::\n\n purpletag serve -h\n usage: purpletag serve [options]\n\n Launch a web service to visualize results.\n\n Options\n -h, --help help\n -n number of tags to show from each party [default: 100]\n\nThe web data is stored in ``/data/purpletag/web``. The default port is\nset by the config file. So http://0.0.0.0:8000/1.html might look\nsomething like this:\n\n.. figure:: https://raw.githubusercontent.com/casmlab/purpletag/master/docs/sample-graph.png\n :alt: sample\n\n sample\n\n\n\n\n\nHistory\n-------\n\n0.1.3 (2014-05-22)\n++++++++++++++++++\n* Bug fixes in parse\n* Install web data\n* Enable time series selection\n* Graph ranks instead of scores\n* UI tweaks\n\n0.1.1 (2014-05-15)\n++++++++++++++++++\n\n* Add UI support\n* Bug fixes\n* standardize Chi-square scores\n* support historical parsing\n\n\n0.1.0 (2014-05-02)\n++++++++++++++++++\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/casmlab/purpletag", "keywords": "purpletag", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "purpletag", "package_url": "https://pypi.org/project/purpletag/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/purpletag/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/casmlab/purpletag" }, "release_url": "https://pypi.org/project/purpletag/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "A tool to track hashtags used by members of the U.S. congress.", "version": "0.1.4" }, "last_serial": 2435279, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "869f05cdf170074c0e73539879b09e03", "sha256": "69c165a7c08a926eab20bc5a322e4dc8f32fd49f1b8e169a17645ba2e384b7de" }, "downloads": -1, "filename": "purpletag-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "869f05cdf170074c0e73539879b09e03", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 15037, "upload_time": "2014-05-02T20:24:12", "url": "https://files.pythonhosted.org/packages/c4/40/97b2a4b49b36c560dd318c1fe00384a74af4e4d9c0af0a1b8927e949f919/purpletag-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0be5d0f19bb7424c6a4219be568efc3c", "sha256": "ff8b44395f5c9383d678d6613435adde9c7d1b0397aa217cdb52be5a36b51b15" }, "downloads": -1, "filename": "purpletag-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0be5d0f19bb7424c6a4219be568efc3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11072, "upload_time": "2014-05-02T20:24:09", "url": "https://files.pythonhosted.org/packages/09/6f/af32848e7c1d934ea703a4d8774efbd29b64ebfc985bae80a1c7fa25f23d/purpletag-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "990421c2216981e3815a31620e1b48e1", "sha256": "f5d3a5b391b678605cca07a5dd058022589fb89e139ed1bedf7f2e7eabd76380" }, "downloads": -1, "filename": "purpletag-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "990421c2216981e3815a31620e1b48e1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18278, "upload_time": "2014-05-15T20:03:33", "url": "https://files.pythonhosted.org/packages/e6/5b/ec11c52c25a67d188ebfb33bb9f2786d0b0e0da881a2b76dd0c3851838e4/purpletag-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bed9849df0557cdf5a850d7d25228eb6", "sha256": "66dbabee1ca0b3867fdcd228024b846f87d28e460b81eadd55181cd2dea0a335" }, "downloads": -1, "filename": "purpletag-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bed9849df0557cdf5a850d7d25228eb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15032, "upload_time": "2014-05-15T20:03:29", "url": "https://files.pythonhosted.org/packages/80/ae/3dce1aff94c57ad918d9f9df1c872beba755066b822352acd91e0831c692/purpletag-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "15348204e00f6c9ffb7eae4419a4df71", "sha256": "9d9b5f73b1efd3e73f78363e0ef817683bfbf56fa06a04f47bc4f00c937e331e" }, "downloads": -1, "filename": "purpletag-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "15348204e00f6c9ffb7eae4419a4df71", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19157, "upload_time": "2014-05-22T16:05:46", "url": "https://files.pythonhosted.org/packages/a3/38/f63b2fbbd391d05885dd6a7be57e9c90770cdf2880adcf2a74481e934d7f/purpletag-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce303c6a1f29a9454e95334420d89ae5", "sha256": "638339a90e9cc81d16da278a2e867d04d60b1c2fb2bdbcc90f93337c88cf3881" }, "downloads": -1, "filename": "purpletag-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ce303c6a1f29a9454e95334420d89ae5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15777, "upload_time": "2014-05-22T16:05:42", "url": "https://files.pythonhosted.org/packages/91/c2/ec7f536092df1f50a8b353b2324d42ac1516dc0aea95ae23b120558aecc6/purpletag-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "305775293382f38d2efae113a1598717", "sha256": "b0949e4609939cc216b04a929073a4ceb0c1294acc6f63cf6f36134291df0084" }, "downloads": -1, "filename": "purpletag-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "305775293382f38d2efae113a1598717", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17605, "upload_time": "2016-11-01T14:51:37", "url": "https://files.pythonhosted.org/packages/c3/bf/3a2efd939137451edaf60d2e0d74779ba8c848a6015ec5e77714fa43248f/purpletag-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6645dee7295c8a8a4be7c9b3a8e1308b", "sha256": "0738bd6b8f26de9df55b94ea881f0196b11585d34c3d808502aec52a7c658fc4" }, "downloads": -1, "filename": "purpletag-0.1.4.tar.gz", "has_sig": false, "md5_digest": "6645dee7295c8a8a4be7c9b3a8e1308b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16207, "upload_time": "2016-11-01T14:51:34", "url": "https://files.pythonhosted.org/packages/e2/35/1873c3780cbf94f27e85a2c403fdf5ce57c77217f570f75a3318d4064474/purpletag-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "305775293382f38d2efae113a1598717", "sha256": "b0949e4609939cc216b04a929073a4ceb0c1294acc6f63cf6f36134291df0084" }, "downloads": -1, "filename": "purpletag-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "305775293382f38d2efae113a1598717", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17605, "upload_time": "2016-11-01T14:51:37", "url": "https://files.pythonhosted.org/packages/c3/bf/3a2efd939137451edaf60d2e0d74779ba8c848a6015ec5e77714fa43248f/purpletag-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6645dee7295c8a8a4be7c9b3a8e1308b", "sha256": "0738bd6b8f26de9df55b94ea881f0196b11585d34c3d808502aec52a7c658fc4" }, "downloads": -1, "filename": "purpletag-0.1.4.tar.gz", "has_sig": false, "md5_digest": "6645dee7295c8a8a4be7c9b3a8e1308b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16207, "upload_time": "2016-11-01T14:51:34", "url": "https://files.pythonhosted.org/packages/e2/35/1873c3780cbf94f27e85a2c403fdf5ce57c77217f570f75a3318d4064474/purpletag-0.1.4.tar.gz" } ] }