{ "info": { "author": "Fiona Pigott, Jeff Kolb, Josh Montague, Aaron Gonzales", "author_email": "fpigott@twitter.com", "bugtrack_url": null, "classifiers": [], "description": "Tweet Parser\n============\n\nAuthors: `Fiona Pigott `__, `Jeff\nKolb `__, `Josh\nMontague `__, `Aaron\nGonzales `__\n\nGoal:\n-----\n\nAllow reliable parsing of Tweets delivered by the Gnip platform, in both\nactivity-streams and original formats.\n\nStatus:\n-------\n\nThis package can be installed by cloning the repo and using\n``pip install -e .``, or by using ``pip install tweet_parser``.\n\nAs of version 1.0.5, the package works with Python 2 and 3, and the \nAPI should be relatively stable. Recommended to use the more recent release. \nCurrent release is 1.13.2\n\nCurrently, this parser does not explicitly support Public API Twitter\ndata.\n\nUsage:\n------\n\nThis package is intended to be used as a Python module inside your other\nTweet-related code. An example Python program (after pip installing the\npackage) would be:\n\n.. code:: python\n\n from tweet_parser.tweet import Tweet\n from tweet_parser.tweet_parser_errors import NotATweetError\n import fileinput\n import json\n\n for line in fileinput.FileInput(\"gnip_tweet_data.json\"):\n try:\n tweet_dict = json.loads(line)\n tweet = Tweet(tweet_dict)\n except (json.JSONDecodeError,NotATweetError):\n pass\n print(tweet.created_at_string, tweet.all_text)\n\nI've also added simple command-line utility:\n\n.. code:: bash\n\n python tools/parse_tweets.py -f\"gnip_tweet_data.json\" -c\"created_at_string,all_text\"\n\nTesting:\n--------\n\nA Python ``test_tweet_parser.py`` package exists in ``test/``.\n\nThe most important thing that it tests is the equivalence of outputs\nwhen comparing both activity-streams input and original-format input.\nAny new getter will be tested by running\n``test$ python test_tweet_parser.py``, as the test checks every method\nattached to the Tweet object, for every test tweet stored in\n``test/tweet_payload_examples``. For any cases where it is expected that\nthe outputs are different (e.g., outputs that depend on poll options),\nconditional statements should be added to this test.\n\nAn option also exists for run-time checking of Tweet payload formats.\nThis compares the set of all Tweet field keys to a superset of all\npossible keys, as well as a minimum set of all required keys, to make\nsure that each newly loaded Tweet fits those parameters. This shouldn't\nbe run every time you load Tweets (for one, it's slow), but is\nimplemented to use as a periodic check against Tweet format changes.\nThis option is enabled with ``--do_format_validation`` on the command\nline, and by setting the keyword argument ``do_format_validation`` to\n``True`` when initializing a ``Tweet`` object.\n\nContributing\n------------\n\nSubmit bug reports or feature requests through GitHub Issues, with\nself-contained minimum working examples where appropriate.\n\nTo contribute code, fork this repo, create your own local feature\nbranch, make your changes, test them, and submit a pull request to the\nmaster branch. The contribution guidelines specified in the ``pandas``\n`documentation `__\nare a great reference.\n\nWhen you submit a change, change the version number. For bug fixes and\nnon-breaking changes that do not affect the top-level Tweet object API \n(fixing a bug or changing the internals of a getter while package naming/structure\nremains the same), increment the last number (X.Y.Z -> X.Y.Z+1) in\n``setup.py``. For changes that do affect the top-level Tweet object API (e.g., adding a \nnew getter), increment the middle number (X.Y.Z -> X.Y+1.0).\n\nGuidelines for new getters\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA *getter* is a method in the Tweet class and the accompanying code in\nthe ``getter_methods`` module. A getter for some property should:\n\n- be named ````, a method in ``Tweet`` decorated with\n ``@lazy_property``\n- have a corresponding method named\n ``get_(tweet)`` in the ``getter_methods`` module that\n implements the logic, nested uner the appropriate submodule (a text\n property probably lives under the ``getter_methods.tweet_text``\n submodule) \n- provide the exact same output for original format and\n activity-streams format Tweet input, except in the case where certain\n information is unavailable (see ``get_poll_options``).\n\nIn general, prefer that the ``get_`` work on a simple Tweet\ndictionary as well as a Tweet object (this makes unit testing easier).\nThis means that you might use ``is_original_format(tweet)`` rather than\n``tweet.is_original_format`` to check format inside of a getter.\n\nAdding unit tests for your getter in the docstrings in the \"Example\"\nsection is helpful. See existing getters for examples.\n\nIn general, make detailed docstrings with examples in\n``get_``, and more concise dosctrings in ``Tweet``, with a\nreference for where to find the ``get_`` getter that\nimplements the logic.\n\nStyle\n~~~~~\n\nAdhere to the PEP8 style. Using a Python linter (like flake8) is\nreccomended.\n\nFor documentation style, use `Google-style\ndocstrings `__.\nRefer to the `Python docstest\ndocumentation `__ for\ndoctest guidelines.\n\nTesting\n~~~~~~~\n\nCreate an isolated virtual environment for testing (there are currently\nno external dependencies for this library).\n\nTest your new feature by reinstalling the library in your virtual\nenvironment and running the test script as shown below. Fix any issues\nuntil all tests pass.\n\n.. code-block:: bash\n\n (env) [tweet_parser]$ pip install -e .\n (env) [tweet_parser]$ cd test/; python test_tweet_parser.py; cd -\n\nFurthermore, if contributing a new accessor or getter method for payload\nelements, verify the code works as you intended by running the\n``parse_tweets.py`` script with your new field, as shown below. Check\nthat both input types produce the intended output.\n\nNote that FieldDeprecationWarnings will appear while testing for certain getters, this is expected behavior.\n\n.. code-block:: bash\n\n (env) [tweet_parser]$ pip install -e .\n (env) [tweet_parser]$ python tools/parse_tweets.py -f test/tweet_payload_examples/activity_streams_examples.json -c \n\nAnd lastly, if you've added new docstrings and doctests, from the\n``docs`` directory, run ``make html`` (to check docstring formatting)\nand ``make doctest`` to run the doctests.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/twitterdev/tweet_parser", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tweet-parser", "package_url": "https://pypi.org/project/tweet-parser/", "platform": "", "project_url": "https://pypi.org/project/tweet-parser/", "project_urls": { "Homepage": "https://github.com/twitterdev/tweet_parser" }, "release_url": "https://pypi.org/project/tweet-parser/1.13.2/", "requires_dist": null, "requires_python": "", "summary": "Tools for Tweet parsing", "version": "1.13.2" }, "last_serial": 4973913, "releases": { "1.0.1.dev1": [ { "comment_text": "", "digests": { "md5": "067de7cd2e8d7e41b2b6635cdbcff2fc", "sha256": "5086fec5c546be10803616f5c1d518de49f4d11b9f96d9865399e8df5d721f58" }, "downloads": -1, "filename": "tweet_parser-1.0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "067de7cd2e8d7e41b2b6635cdbcff2fc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 12032, "upload_time": "2017-07-21T17:48:43", "url": "https://files.pythonhosted.org/packages/79/05/18c8079b4f80e353a9113601b3ce0f0cf56d6a1dca184e35334a799157f2/tweet_parser-1.0.1.dev1.tar.gz" } ], "1.0.2.dev1": [ { "comment_text": "", "digests": { "md5": "983a9af856978052e233ea5f53d9f011", "sha256": "f5228fb1e7a726818bdee5d73745dd12ddf85f099939ae296cecda5b2a011f48" }, "downloads": -1, "filename": "tweet_parser-1.0.2.dev1.tar.gz", "has_sig": false, "md5_digest": "983a9af856978052e233ea5f53d9f011", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 12076, "upload_time": "2017-07-21T19:39:01", "url": "https://files.pythonhosted.org/packages/e1/42/9f211b727cdfb2f4d324ec28c308f18a7ba445830a5862a879263a0cd2a2/tweet_parser-1.0.2.dev1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "ccf5598cb1c63000e43af39cdd975a85", "sha256": "49e062c83325dfd0e9f9fbc3edd366713b4dba185f247c4e9b7b7e6bed9e0e91" }, "downloads": -1, "filename": "tweet_parser-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ccf5598cb1c63000e43af39cdd975a85", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 11825, "upload_time": "2017-07-28T16:53:55", "url": "https://files.pythonhosted.org/packages/83/56/5814121bb80b8cb69fdde217822d1b147c93c327a76403052fad0a9b94b4/tweet_parser-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "a3213174131c2b38c3ab8d4e4933aff4", "sha256": "dc7235e58e57defd2ec68c188aa12e53a23e6654743d5118eaa13c0b6cb70bb9" }, "downloads": -1, "filename": "tweet_parser-1.0.5.tar.gz", "has_sig": false, "md5_digest": "a3213174131c2b38c3ab8d4e4933aff4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17736, "upload_time": "2017-08-14T20:10:07", "url": "https://files.pythonhosted.org/packages/92/dc/30c10ba1448ff39ecc2abc8c3bde7578cabe60ee39ae17fd657aa5118ca1/tweet_parser-1.0.5.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "3dc379797544631fcde6b082c59140ac", "sha256": "be970f16accb23d54490598a5a79e1bf126164a8ea3306aff5f86a3148fdd420" }, "downloads": -1, "filename": "tweet_parser-1.0.7.tar.gz", "has_sig": false, "md5_digest": "3dc379797544631fcde6b082c59140ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24105, "upload_time": "2017-08-24T22:46:44", "url": "https://files.pythonhosted.org/packages/2b/b8/372c82370304080694c171fbbd1b324a3689b8bc1273cb55db86f824b7aa/tweet_parser-1.0.7.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "0b23ad8747528b41d775370b819eace6", "sha256": "7aef3058dc46b16d01eebc8126dd6b9d39a5e94d1b0d59b9a2031b19c27bb772" }, "downloads": -1, "filename": "tweet_parser-1.0.9.tar.gz", "has_sig": false, "md5_digest": "0b23ad8747528b41d775370b819eace6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26573, "upload_time": "2017-09-20T17:53:49", "url": "https://files.pythonhosted.org/packages/c5/9c/c17bc3a80b29204c50631866ea10f4fe0c0fcfcec653cefb9ef930489041/tweet_parser-1.0.9.tar.gz" } ], "1.11.0": [ { "comment_text": "", "digests": { "md5": "1fd6f1217be161835ac34fd1ad396279", "sha256": "2603340ed6e9c13ce2e57289f4e0847acb7f6ce8940a7f66afc5b84a56e5e372" }, "downloads": -1, "filename": "tweet_parser-1.11.0.tar.gz", "has_sig": false, "md5_digest": "1fd6f1217be161835ac34fd1ad396279", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27036, "upload_time": "2017-09-26T22:49:59", "url": "https://files.pythonhosted.org/packages/5c/5d/878c9c7bf000909a4db0e82741c7c5a664f3368f9765a1ce0eedcaf6a5a8/tweet_parser-1.11.0.tar.gz" } ], "1.13.0": [ { "comment_text": "", "digests": { "md5": "c314fb6616db59a2e95c7770e28d2230", "sha256": "0878be0828a0ec7b06aab4b1fc7d3bca949d57d7e12081b856ccb14d8b745f59" }, "downloads": -1, "filename": "tweet_parser-1.13.0.tar.gz", "has_sig": false, "md5_digest": "c314fb6616db59a2e95c7770e28d2230", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27939, "upload_time": "2017-11-06T19:03:08", "url": "https://files.pythonhosted.org/packages/ce/5a/6d0d38f775dab23c362d649c9bd2f6af03f62d9591941af34479ab286aa5/tweet_parser-1.13.0.tar.gz" } ], "1.13.1": [ { "comment_text": "", "digests": { "md5": "013f325644ba24cbdfd8ee36480643a1", "sha256": "89c4d4df6dc6a2f23e59123fe64155b78fd23bb5e4ce9e976c772e4c708ee6f0" }, "downloads": -1, "filename": "tweet_parser-1.13.1.tar.gz", "has_sig": false, "md5_digest": "013f325644ba24cbdfd8ee36480643a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28783, "upload_time": "2018-05-18T17:47:33", "url": "https://files.pythonhosted.org/packages/72/68/66cfc553368796e56920f7be8ac4a1121eb666b16407a0b150114ac8487c/tweet_parser-1.13.1.tar.gz" } ], "1.13.2": [ { "comment_text": "", "digests": { "md5": "bd2545e2d70a08d57e9596664740685b", "sha256": "335816157a06d49f410f096490067e45bdbe842922ba3729a60b5053fdb00885" }, "downloads": -1, "filename": "tweet_parser-1.13.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bd2545e2d70a08d57e9596664740685b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 34012, "upload_time": "2019-03-22T18:18:44", "url": "https://files.pythonhosted.org/packages/4b/ea/cb82efb43dbcb115ea447313fbd287ff66349b34bdfdb4a78e25d3a42cb0/tweet_parser-1.13.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "18def490e76df769f561c1620c106824", "sha256": "c705fc7cbfbac2d713878b32e3bf010b987218f114234780496b056b5f4f332c" }, "downloads": -1, "filename": "tweet_parser-1.13.2.tar.gz", "has_sig": false, "md5_digest": "18def490e76df769f561c1620c106824", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28976, "upload_time": "2019-03-22T18:18:46", "url": "https://files.pythonhosted.org/packages/98/27/f02fbe44e5b1757246a4a53b8f24695835787d835729997c953459df5efc/tweet_parser-1.13.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bd2545e2d70a08d57e9596664740685b", "sha256": "335816157a06d49f410f096490067e45bdbe842922ba3729a60b5053fdb00885" }, "downloads": -1, "filename": "tweet_parser-1.13.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bd2545e2d70a08d57e9596664740685b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 34012, "upload_time": "2019-03-22T18:18:44", "url": "https://files.pythonhosted.org/packages/4b/ea/cb82efb43dbcb115ea447313fbd287ff66349b34bdfdb4a78e25d3a42cb0/tweet_parser-1.13.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "18def490e76df769f561c1620c106824", "sha256": "c705fc7cbfbac2d713878b32e3bf010b987218f114234780496b056b5f4f332c" }, "downloads": -1, "filename": "tweet_parser-1.13.2.tar.gz", "has_sig": false, "md5_digest": "18def490e76df769f561c1620c106824", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28976, "upload_time": "2019-03-22T18:18:46", "url": "https://files.pythonhosted.org/packages/98/27/f02fbe44e5b1757246a4a53b8f24695835787d835729997c953459df5efc/tweet_parser-1.13.2.tar.gz" } ] }