{ "info": { "author": "Randall Degges", "author_email": "r@rdegges.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "python-ipify\n============\n\nThe official client library for `ipify `_: *A Simple IP\nAddress API*.\n\n.. image:: https://img.shields.io/pypi/v/ipify.svg\n :alt: python-ipify Release\n :target: https://pypi.python.org/pypi/ipify\n\n.. image:: https://img.shields.io/pypi/dm/ipify.svg\n :alt: python-ipify Downloads\n :target: https://pypi.python.org/pypi/ipify\n\n.. image:: https://img.shields.io/travis/rdegges/python-ipify.svg\n :alt: python-ipify Build\n :target: https://travis-ci.org/rdegges/python-ipify\n\n.. image:: https://coveralls.io/repos/rdegges/python-ipify/badge.svg?branch=master\n :target: https://coveralls.io/r/rdegges/python-ipify?branch=master\n\n\nMeta\n----\n\n- Author: Randall Degges\n- Email: r@rdegges.com\n- Site: http://www.rdegges.com\n- Status: maintained, active\n\n\nPurpose\n-------\n\n`ipify `_ is the best IP address lookup service on the\ninternet. It's fast, simple, scalable, open source, and well-funded (*by me!*).\n\nIn short: if you need a way to pragmatically get your public IP address, ipify\nis the best possible choice!\n\nThis library will retrieve your public IP address from ipify's API service, and\nreturn it as a string. It can't get any simpler than that.\n\nThis library also has some other nice features you might care about:\n\n- If a request fails for any reason, it is re-attempted 3 times using an\n exponential backoff algorithm for maximum effectiveness.\n- This library handles exceptions properly, and usage examples below show you\n how to deal with errors in a foolproof way.\n- This library only makes API requests over HTTPS.\n\n\nInstallation\n------------\n\nTo install ``ipify``, simply run:\n\n.. code-block:: console\n\n $ pip install ipify\n\nThis will install the latest version of the library automatically.\n\n\nUsage\n-----\n\nUsing this library is very simple. Here's a simple example:\n\n.. code-block:: python\n\n >>> from ipify import get_ip\n >>> ip = get_ip()\n >>> ip\n u'96.41.136.144'\n\nNow, in regards to exception handling, there are several ways this can fail:\n\n- The ipify service is down (*not likely*), or:\n- Your machine is unable to get the request to ipify because of a network error\n of some sort (DNS, no internet, etc.).\n\nHere's how you can handle all of these edge cases:\n\n.. code-block:: python\n\n from ipify import get_ip\n from ipify.exceptions import ConnectionError, ServiceError\n\n try:\n ip = get_ip()\n except ConnectionError:\n # If you get here, it means you were unable to reach the ipify service,\n # most likely because of a network error on your end.\n except ServiceError:\n # If you get here, it means ipify is having issues, so the request\n # couldn't be completed :(\n except:\n # Something else happened (non-ipify related). Maybe you hit CTRL-C\n # while the program was running, the kernel is killing your process, or\n # something else all together.\n\nIf you want to simplify the above error handling, you could also do the\nfollowing (*it will catch any sort of ipify related errors regardless of what\ntype they may be*):\n\n.. code-block:: python\n\n from ipify import get_ip\n from ipify.exceptions import IpifyException\n\n try:\n ip = get_ip()\n except IpifyException:\n # If you get here, then some ipify exception occurred.\n except:\n # If you get here, some non-ipify related exception occurred.\n\nOne thing to keep in mind: regardless of how you decide to handle exceptions,\nthe ipify library will retry any failed requests 3 times before ever raising\nexceptions -- so if you *do* need to handle exceptions, just remember that retry\nlogic has already been attempted.\n\n\nContributing\n------------\n\nThis project is only possible due to the amazing contributors who work on it!\n\nIf you'd like to improve this library, please send me a pull request! I'm happy\nto review and merge pull requests.\n\nThe standard contribution workflow should look something like this:\n\n- Fork this project on Github.\n- Make some changes in the master branch (*this project is simple, so no need to\n complicate things*).\n- Send a pull request when ready.\n\nAlso, if you're making changes, please write tests for your changes -- this\nproject has a full test suite you can easily modify / test.\n\nTo run the test suite, you can use the following commands:\n\n.. code-block:: console\n\n $ pip install -e .\n $ pip install -r requirements.txt\n $ python manage.py test\n\n\nChange Log\n----------\n\nAll library changes, in descending order.\n\n\nVersion 1.0.0\n*************\n\n**Released May 6, 2015.**\n\n- First release!", "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/rdegges/python-ipify", "keywords": "python api client ipify ip address public ipv4 ipv6 service", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "ipify", "package_url": "https://pypi.org/project/ipify/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ipify/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rdegges/python-ipify" }, "release_url": "https://pypi.org/project/ipify/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "The official client library for ipify: A Simple IP Address API.", "version": "1.0.0" }, "last_serial": 1536715, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4b60638caaef9f4179b7b2fc773a4838", "sha256": "e0d486997e484adbf49008a22b4b5370f675320100ab1af4aaba7e3070fb5d35" }, "downloads": -1, "filename": "ipify-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4b60638caaef9f4179b7b2fc773a4838", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8932, "upload_time": "2015-05-07T05:25:06", "url": "https://files.pythonhosted.org/packages/6e/f0/eeeea218faaef1cd4db0ef7578ec43be1c9ea4e56fc2df797d4b0df8e2e7/ipify-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee9260258d72fd6e85f78de96e5818d7", "sha256": "9941659b9a89a09478b491ec355446b97b8dec1770e317dd56b4c26bbab50840" }, "downloads": -1, "filename": "ipify-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ee9260258d72fd6e85f78de96e5818d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7205, "upload_time": "2015-05-07T05:25:10", "url": "https://files.pythonhosted.org/packages/2e/18/4fbcf738517e3d21cd79f4e822c588491a9b09e3c639bf50c4ceadfa80b0/ipify-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4b60638caaef9f4179b7b2fc773a4838", "sha256": "e0d486997e484adbf49008a22b4b5370f675320100ab1af4aaba7e3070fb5d35" }, "downloads": -1, "filename": "ipify-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4b60638caaef9f4179b7b2fc773a4838", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8932, "upload_time": "2015-05-07T05:25:06", "url": "https://files.pythonhosted.org/packages/6e/f0/eeeea218faaef1cd4db0ef7578ec43be1c9ea4e56fc2df797d4b0df8e2e7/ipify-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee9260258d72fd6e85f78de96e5818d7", "sha256": "9941659b9a89a09478b491ec355446b97b8dec1770e317dd56b4c26bbab50840" }, "downloads": -1, "filename": "ipify-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ee9260258d72fd6e85f78de96e5818d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7205, "upload_time": "2015-05-07T05:25:10", "url": "https://files.pythonhosted.org/packages/2e/18/4fbcf738517e3d21cd79f4e822c588491a9b09e3c639bf50c4ceadfa80b0/ipify-1.0.0.tar.gz" } ] }