{ "info": { "author": "Zhijing Jin", "author_email": "zhijing.jin@connect.hku.hk", "bugtrack_url": null, "classifiers": [], "description": "# email2country (Python Package)\nThis is an easy-to-use Python package to look up the country given an email address. The GitHub project is at [email2country](https://github.com/zhijing-jin/email2country).\n\n## Installation\nRequirement: Python 3\n```bash\npip install --upgrade git+git://github.com/zhijing-jin/email2country.git\n```\n\n## How to Run\n(All country names are conssitent with ISO 3166-1)\n\n#### Function 1: Find the country where the email server is located\n```python\n>>> from email2country import email2country\n>>> email2country('zhijing@mit.edu')\n'United States'\n```\nOr you can just use the domain\n```python\n>>> email2country('connect.hku.hk')\n'Hong Kong'\n```\n#### Function 2: Find the country where the institution of this email address is located\n```python\n>>> from email2country import Email, email2institution_country\n\n>>> email2institution_country('zhijing@mit.edu')\n'United States'\n\n>>> email2institution_country('zhijing@gmail.com')\n[Info] Email domain \"gmail.com\" is generic. There is no specific country.\n\n>>> email2institution_country('zhijing@gmail.com111')\n[Info] Country not found for \"gmail.com111\"\n```\n#### Function 3: Look up in batches\n```python\n>>> from email2country import batch_email2institution_country\n>>> batch_email2institution_country(['nyu.edu','gmail.com', 'hku.hk'])\n['United States', None, 'Hong Kong']\n\n# or you can enable the \"enable warning\" option:\n>>> batch_email2institution_country(['nyu.edu','gmail.com', 'hku.hk'], enable_warning=True)\n[Info] Email domain \"gmail.com\" is generic. There is no specific country.\n['United States', None, 'Hong Kong']\n\n# Similarly, you can try email2country lookup\n>>> from email2country import batch_email2country\n>>> batch_email2country(['nyu.edu','gmail.com', 'hku.hk'])\n```\n#### Function 4: Customize your own function\nYou can use the `EmailCountryChecker` object directly:\n```python\n>>> from email2country import EmailCountryChecker\n>>> checker = EmailCountryChecker()\n>>> checker.get_institution_country('hku.hk', enable_warning=True)\n'Hong Kong'\n>>> # ... Perform your own actions\n```\nOr you can use the `Email` object\n```python\n>>> from email2country import Email \n>>> addr = 'zhijing@mit.edu'\n>>> email = Email(addr)\n>>> email.country\n'United States'\n>>> email.institution_country\n'United States'\n```\n## Contact\nIf you have more questions, feel free to contact the author [Zhijing Jin (Miss)](mailto:zhijing.jin@connect.hku.hk).", "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/zhijing-jin/email2country", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "email2country", "package_url": "https://pypi.org/project/email2country/", "platform": "", "project_url": "https://pypi.org/project/email2country/", "project_urls": { "Homepage": "https://github.com/zhijing-jin/email2country" }, "release_url": "https://pypi.org/project/email2country/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A package to look up the country of email addresses and domains", "version": "0.1.0" }, "last_serial": 5965070, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a2ffae0e7c9649ffe0c2369ca5ac7a10", "sha256": "a38a3f237f555e30ef49f70821a3fb0d4ab15f85750908271f910c7ea8431531" }, "downloads": -1, "filename": "email2country-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a2ffae0e7c9649ffe0c2369ca5ac7a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 193680, "upload_time": "2019-10-12T18:43:18", "url": "https://files.pythonhosted.org/packages/30/d6/7a8d5412b54e738ae38a9551c58a8eea92c22831167cc0631e45e973dfe5/email2country-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2ffae0e7c9649ffe0c2369ca5ac7a10", "sha256": "a38a3f237f555e30ef49f70821a3fb0d4ab15f85750908271f910c7ea8431531" }, "downloads": -1, "filename": "email2country-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a2ffae0e7c9649ffe0c2369ca5ac7a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 193680, "upload_time": "2019-10-12T18:43:18", "url": "https://files.pythonhosted.org/packages/30/d6/7a8d5412b54e738ae38a9551c58a8eea92c22831167cc0631e45e973dfe5/email2country-0.1.0.tar.gz" } ] }