{ "info": { "author": "Jeremy Ephron", "author_email": "jeremyephron@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# simple-gmail\n\nA simple Gmail API client in Python for applications.\n\nCurrent Supported Behavior:\n* Sending html messages\n* Sending messages with attachments\n* Sending messages with your Gmail account signature\n* Retrieving messages with the full suite of Gmail's search capabilities\n\n## Getting Started\nThe only setup required is to download a \"client secrets\" file from Google that will allow your applications to do its thing.\n\nFollow the instructions here: https://developers.google.com/gmail/api/quickstart/python.\n\nName the file you download \"client_secrets.json\" and place it in the root directory of your application.\n\nThe first time you create a new instance of the `Gmail` class, a browser window will open and you'll be asked to give permissions to the application. This will only happen once.\n\nYou are now good to go!\n\n## Usage\n### Send a simple message:\n```python\nfrom simplegmail import Gmail\n\ngmail = Gmail() # will open a browser window to ask you to log in and authenticate\n\nparams = {\n \"to\": \"you@youremail.com\",\n \"sender\": \"me@myemail.com\",\n \"subject\": \"My first email\",\n \"msg_html\": \"

Woah, my first email!


This is an HTML email.\",\n \"msg_plain\": \"Hi\\nThis is a plain text email.\",\n \"signature\": True # use my account signature\n}\ngmail.send_message(**params) # equivalent to send_message(to=\"you@youremail.com\", sender=...)\n```\n\n### Send a message with attachments, cc, bcc fields:\n```python\nfrom simplegmail import Gmail\n\ngmail = Gmail()\n\nparams = {\n \"to\": \"you@youremail.com\",\n \"sender\": \"me@myemail.com\",\n \"cc\": [\"bob@bobsemail.com\"],\n \"bcc\": [\"marie@gossip.com\", \"hidden@whereami.com\"],\n \"subject\": \"My first email\",\n \"msg_html\": \"

Woah, my first email!


This is an HTML email.\",\n \"msg_plain\": \"Hi\\nThis is a plain text email.\",\n \"attachments\": [\"path/to/something/cool.pdf\", \"path/to/image.jpg\", \"path/to/script.py\"],\n \"signature\": True # use my account signature\n}\ngmail.send_message(**params) # equivalent to send_message(to=\"you@youremail.com\", sender=...)\n```\n\nIt couldn't be easier!\n\n### Retrieving messages:\n```python\nfrom simplegmail import Gmail\n\ngmail = Gmail()\n\n# Unread messages in your inbox\nmessages = gmail.get_unread_inbox()\n\n# Starred messages\nmessages = gmail.get_starred_messages()\n\n# ...and many more easy to use functions...\n\n# Print them out!\nfor message in messages:\n print(\"To: \" + message['To'])\n print(\"From: \" + message['From'])\n print(\"Subject: \" + message['Subject'])\n print(\"Date: \" + message['Date'])\n print(\"Preview: \" + message['Snippet'])\n\n # print(\"Message Body: \" + message['Message Body'])\n```\n\n### Retrieving messages (advanced, with queries!):\n```python\nfrom simplegmail import Gmail\nfrom simplegmail.query import construct_query\n\ngmail = Gmail()\n\n# Unread messages in inbox with label \"Work\"\nmessages = gmail.get_unread_inbox(label_ids=[\"Work\"])\n\n# For even more control use queries:\n# Messages that are: newer than 2 days old, unread, labeled \"Work\" or both \"Homework\" and \"CS\"\nquery_params = {\n \"newer_than\": (2, \"day\"),\n \"unread\": True,\n \"labels\":[[\"Work\"], [\"Homework\", \"CS\"]]\n}\n\nmessages = gmail.get_messages(query=construct_query(query_params))\n\n# We could have also accomplished this with\n# messages = gmail.get_unread_messages(query=construct_query(newer_than=(2, \"day\"), labels=[[\"Work\"], [\"Homework\", \"CS\"]]))\n# There are many, many different ways of achieving the same result with search.\n```\n\n### Retrieving messages (more advanced, with more queries!):\n```python\nfrom simplegmail import Gmail\nfrom simplegmail.query import construct_query\n\ngmail = Gmail()\n\n# For even more control use queries:\n# Messages that are either:\n# newer than 2 days old, unread, labeled \"Work\" or both \"Homework\" and \"CS\"\n# or\n# newer than 1 month old, unread, labeled \"Top Secret\", but not starred.\n\n# Construct our two queries separately\nquery_params_1 = {\n \"newer_than\": (2, \"day\"),\n \"unread\": True,\n \"labels\":[[\"Work\"], [\"Homework\", \"CS\"]]\n}\n\nquery_params_2 = {\n \"newer_than\": (1, \"month\"),\n \"unread\": True,\n \"labels\": [\"Top Secret\"],\n \"starred\": True,\n \"exclude_starred\": True\n}\n\n# construct_query() will create both query strings and \"or\" them together.\nmessages = gmail.get_messages(query=construct_query(query_params_1, query_params_2))\n```\n\nFor more on what you can do with queries, read the docstring for `construct_query()` in `query.py`.\n\n## Feedback\nIf there is functionality you'd like to see added, or any bugs in this project, please let me know by posting an issue or submitting a pull request!\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/illiteratecoder/simple-gmail", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "simplegmail", "package_url": "https://pypi.org/project/simplegmail/", "platform": "", "project_url": "https://pypi.org/project/simplegmail/", "project_urls": { "Homepage": "https://github.com/illiteratecoder/simple-gmail" }, "release_url": "https://pypi.org/project/simplegmail/1.0.0/", "requires_dist": [ "google-api-python-client (>=1.7.3)", "bs4 (>=0.0.1)", "py-dateutil (>=2.2)", "oauth2client (>=4.1.3)" ], "requires_python": "", "summary": "A simple Python API client for Gmail.", "version": "1.0.0" }, "last_serial": 4892742, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9392b41ae45ce50968a49349fc978790", "sha256": "44a11f83860fdb11135c6a0a90a9097eeefcc3c526f62a24cd258bd1fe992794" }, "downloads": -1, "filename": "simplegmail-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9392b41ae45ce50968a49349fc978790", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11005, "upload_time": "2019-02-28T11:59:16", "url": "https://files.pythonhosted.org/packages/f4/ff/4d36dc76100a3fb79efd7c9ffa3e7b98ec4bebec26f34275bd783ac0d464/simplegmail-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed29a08f5ac98a33591917bb5453baab", "sha256": "63fb28861f3f12bd4ab3bd7c7ea0a41932ad44f2537ce8b79cbc968c694b23d6" }, "downloads": -1, "filename": "simplegmail-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ed29a08f5ac98a33591917bb5453baab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10894, "upload_time": "2019-02-28T11:59:18", "url": "https://files.pythonhosted.org/packages/9a/66/0a7c2feac5047b954d21fffbc0aeae3ff2fa525769a733d1ec2b59516ffa/simplegmail-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "85e3083d16ec3c3799cb18d69f0c4a7c", "sha256": "ed7d3fea4447fcbf2983a02fdf657de936909761dab0ecee8a2e787a9a0f4e28" }, "downloads": -1, "filename": "simplegmail-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "85e3083d16ec3c3799cb18d69f0c4a7c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11310, "upload_time": "2019-02-28T12:20:52", "url": "https://files.pythonhosted.org/packages/38/be/ae2a4f2c8dfe409b0ea762783e38a24a0eefcdbdc246016ce22dda41ffae/simplegmail-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d710169d961cb8c9fb364917db18a2e", "sha256": "878665497170d4154d8a04d2e6d5b67ab64519833f3add57a271c5e2e3a1da34" }, "downloads": -1, "filename": "simplegmail-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8d710169d961cb8c9fb364917db18a2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11307, "upload_time": "2019-02-28T12:20:54", "url": "https://files.pythonhosted.org/packages/9e/35/4fdf4452113fa8f58c6bba89454636aa12e4b8079d31d3e03b43d3379f48/simplegmail-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "813239d6d37d60fa1de372cb9e1c56d8", "sha256": "3e14fcd3e2e20c793adc7b0dd984012912a2ebfa0d103e11478f2748ffdca0ab" }, "downloads": -1, "filename": "simplegmail-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "813239d6d37d60fa1de372cb9e1c56d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11314, "upload_time": "2019-02-28T12:23:12", "url": "https://files.pythonhosted.org/packages/55/52/7e0ea23bd15598611bf38b8f42328456d719f0f76d7fbc7a8f3b764f1e07/simplegmail-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ed398341aa1499194f8855a29d8a82", "sha256": "4eb291781d9572542715b6b945555b532045831e23825ee637b173d046f4abd2" }, "downloads": -1, "filename": "simplegmail-0.0.3.tar.gz", "has_sig": false, "md5_digest": "95ed398341aa1499194f8855a29d8a82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11314, "upload_time": "2019-02-28T12:23:13", "url": "https://files.pythonhosted.org/packages/11/b6/fbd5e94b2e5036746840f07e25985608bd2c2923dc8ebd1c202217f87042/simplegmail-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ee50b711d7184dbbf0f9673685666852", "sha256": "e14161253f81636c1f33ba3ba1fbaaafebfacdaed40592b299ebdbe1ec1a4fb2" }, "downloads": -1, "filename": "simplegmail-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ee50b711d7184dbbf0f9673685666852", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11322, "upload_time": "2019-02-28T12:26:09", "url": "https://files.pythonhosted.org/packages/00/8c/658a7a1a328630dc3b78aef5d73767f5ad257be2dd3a8b259612e52d0579/simplegmail-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a9269eecdb7cb0647ca315836f3a479", "sha256": "bd2869951dd2954f8dec927cb1e681465e71963dbe8be55811e906afbc2a8bf4" }, "downloads": -1, "filename": "simplegmail-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3a9269eecdb7cb0647ca315836f3a479", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11321, "upload_time": "2019-02-28T12:26:11", "url": "https://files.pythonhosted.org/packages/cb/13/98e0337453ad8014366bd939a2fb8d20cb6bdba5a6dbce8f55a90f28572a/simplegmail-0.0.4.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "33e082e05dc65ca43e843763665d5a79", "sha256": "cdcfbea38ee617c30fac2da24c3ecf7ed3c2f108965472b5c2c4db5b82b43ca0" }, "downloads": -1, "filename": "simplegmail-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "33e082e05dc65ca43e843763665d5a79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11472, "upload_time": "2019-03-04T05:25:47", "url": "https://files.pythonhosted.org/packages/31/32/53cbd38667982c252a414f41b07bbc4526c8880b7cd0e75dd8d9a8c037f5/simplegmail-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c526803284f58e0368523c61c42be858", "sha256": "a85e6bbaf64f2a35db542bbd3ea0d132dd8c2e61a009230765c6ca5f89a47d58" }, "downloads": -1, "filename": "simplegmail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c526803284f58e0368523c61c42be858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11544, "upload_time": "2019-03-04T05:25:48", "url": "https://files.pythonhosted.org/packages/ad/e4/457e5d195d202da0f003884ab6797375735ad680ef633d891c3b8fa4eaae/simplegmail-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "33e082e05dc65ca43e843763665d5a79", "sha256": "cdcfbea38ee617c30fac2da24c3ecf7ed3c2f108965472b5c2c4db5b82b43ca0" }, "downloads": -1, "filename": "simplegmail-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "33e082e05dc65ca43e843763665d5a79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11472, "upload_time": "2019-03-04T05:25:47", "url": "https://files.pythonhosted.org/packages/31/32/53cbd38667982c252a414f41b07bbc4526c8880b7cd0e75dd8d9a8c037f5/simplegmail-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c526803284f58e0368523c61c42be858", "sha256": "a85e6bbaf64f2a35db542bbd3ea0d132dd8c2e61a009230765c6ca5f89a47d58" }, "downloads": -1, "filename": "simplegmail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c526803284f58e0368523c61c42be858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11544, "upload_time": "2019-03-04T05:25:48", "url": "https://files.pythonhosted.org/packages/ad/e4/457e5d195d202da0f003884ab6797375735ad680ef633d891c3b8fa4eaae/simplegmail-1.0.0.tar.gz" } ] }