{ "info": { "author": "James Arthur", "author_email": "username: thruflo, domain: gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Pylons", "Intended Audience :: Developers", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[pyramid_geoip][] integrates the [MaxMind][] GeoIP database with a [Pyramid][]\n/ SQLAlchemy web application. You can use it to locate incoming requests by\ntheir IP address:\n\n data = request.geoip('89.16.224.130')\n\n data['city'], data['country_code']\n -> 'London', 'GB'\n \n data['latitude'], data['longitude']\n -> 51.514199999999988, -0.093099999999992633\n\nNote that [pyramid_geoip][] stores GeoIP data in an *SQL database* (as opposed\nto storing it on the filesystem) and reads all the data (many MB) into *memory*\non application start. This may well *not* be the pattern / setup you want, in\nwhich case you may find it better to integrate yourself using [pygeoip][].\n\n## Install\n\nInstall using [pip][]:\n\n pip install pyramid_geoip\n\nCreate a `blobs` database table, corresponding to the\n[pyramid_basemodel.blob.Blob][] model class, e.g.: using [alembic][]:\n\n alembic -c $PASTE_CONFIG revision --autogenerate\n alembic -c $PASTE_CONFIG upgrade head\n\n## Configure\n\n[Configure your application][] to include the package (n.b.: see the notes in\nthe update section below before you deploy):\n\n config.include('pyramid_geoip')\n\nOptionally override the data sources, using your\n[PasteDeploy configuration file][]:\n\n geoip.cities_ip4_url=https://example.com/GeoLiteCity.dat.gz\n geoip.cities_ip6_url=https://example.com/GeoLiteCityv6.dat.gz\n\nYou can also use locally vendored data files, which will override the urls / \nread from db machinery if present. The defaults looked for are:\n\n geoip.cities_ip4_path=vendor/GeoLiteCity.dat\n geoip.cities_ip6_path=vendor/GeoLiteCityv6.dat\n\n## Use\n\nUse the utility provided at `request.geoip` to lookup data by IP address, e.g.\nin a [view callable][]: \n \n data = request.geoip()\n\nBy default, this will use the ip address for the incoming request (read from\nthe `REMOTE_ADDR` in the [WSGI environment][], or from the value of the\n`X-Forwarded-For` header if provided by a [load balancer or proxy][]). Note\nalso that it will work for IPv4 and IPv6 addresses.\n\nTo specify the address yourself, e.g.:\n\n data = request.geoip('89.16.224.130')\n \nThe data contains country, region, city, lat lng, etc.:\n\n data['country_code'] # 'GB'\n data['city'] # 'London'\n data['latitude'] # 51.514199999999988\n data['longitude'] # -0.093099999999992633\n\n## Update\n\nMaxMind data loses accuracy over time and consequently MaxMind ship new data\nevery month -- specifically on the first Tuesday of each month. You can call\nthe update module as a script to fetch the latest data:\n\n python ./pyramid_geoip/update.py\n\nNote that you may want to:\n\n1. run this script before you `config.include` the package in your main\n application configuration (as it takes time to download the data and your\n application will hang starting up until the data is available)\n1. schedule this to run monthly\n\n## Tests\n\nTo run the tests, `pip install nose coverage mock` and e.g.:\n\n $ nosetests pyramid_geoip --with-doctest --with-coverage --cover-tests --cover-package pyramid_geoip\n ......\n Name Stmts Miss Cover Missing\n --------------------------------------------------------\n pyramid_geoip 10 0 100% \n pyramid_geoip.interfaces 4 0 100% \n pyramid_geoip.lookup 69 0 100% \n pyramid_geoip.update 12 0 100% \n --------------------------------------------------------\n TOTAL 95 0 100% \n ----------------------------------------------------------------------\n Ran 6 tests in 0.041s\n \n OK\n\n\n[pyramid_geoip]: https://github.com/thruflo/pyramid_geoip\n[MaxMind]: http://www.maxmind.com/en/home\n[Pyramid]: http://pyramid.readthedocs.org\n[pygeoip]: https://pypi.python.org/pypi/pygeoip\n[pip]: http://www.pip-installer.org\n[pyramid_basemodel.blob.Blob]: https://github.com/thruflo/pyramid_basemodel/blob/master/src/pyramid_basemodel/blob.py\n[alembic]: http://alembic.readthedocs.org/en/latest/tutorial.html#auto-generating-migrations\n[Configure your application]: http://pyramid.readthedocs.org/en/latest/narr/configuration.html\n[view callable]: http://pyramid.readthedocs.org/en/latest/narr/views.html\n[PasteDeploy configuration file]: http://pyramid.readthedocs.org/en/latest/narr/paste.html\n[WSGI environment]: http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface\n[load balancer or proxy]: http://en.wikipedia.org/wiki/X-Forwarded-For\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/thruflo/pyramid_geoip", "keywords": null, "license": "This is free and unencumbered software released into the public domain.", "maintainer": null, "maintainer_email": null, "name": "pyramid_geoip", "package_url": "https://pypi.org/project/pyramid_geoip/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_geoip/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/thruflo/pyramid_geoip" }, "release_url": "https://pypi.org/project/pyramid_geoip/0.3/", "requires_dist": null, "requires_python": null, "summary": "Integrate MaxMind GeoIP data with a Pyramid web application.", "version": "0.3" }, "last_serial": 1754672, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d254d86bb1c7ec06d0fc90260927225a", "sha256": "783a28686c9bd1a657e8e0349e9c4470ad8128a02c170a6aac406fbf2682065c" }, "downloads": -1, "filename": "pyramid_geoip-0.1.tar.gz", "has_sig": false, "md5_digest": "d254d86bb1c7ec06d0fc90260927225a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8639, "upload_time": "2013-05-02T16:11:16", "url": "https://files.pythonhosted.org/packages/1a/37/8c626600304b818f43e41eab1da15928ae8db97bf744aee4671d4a0c55b9/pyramid_geoip-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "21c3cd2583ab0a8cccba38d16afac170", "sha256": "113e00978c401581c8f292cd451a0939120b2622b4e20d36ded3ce23d5447f20" }, "downloads": -1, "filename": "pyramid_geoip-0.1.1.tar.gz", "has_sig": false, "md5_digest": "21c3cd2583ab0a8cccba38d16afac170", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8338, "upload_time": "2013-05-07T11:19:40", "url": "https://files.pythonhosted.org/packages/da/d3/5800550b59ecbdc87aff4981ec104c2a12c7dfbe9e4eee0be80b973b2262/pyramid_geoip-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "30bc6c93ef8e101f9081fe5d656ccee0", "sha256": "f1456b0f2ea7869c46179362d941d7833c9168675d1180b70695b505b80cbec9" }, "downloads": -1, "filename": "pyramid_geoip-0.2.tar.gz", "has_sig": false, "md5_digest": "30bc6c93ef8e101f9081fe5d656ccee0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8796, "upload_time": "2013-12-17T12:28:43", "url": "https://files.pythonhosted.org/packages/45/a0/daac40a7a4759abf7888f97535332e94bac06769e3ab59518608bb5ec4a1/pyramid_geoip-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "caac413713de0ebd5ca5f0d14f03e00b", "sha256": "bfe06ab4faaf0ab60b47fb09b84ff301fd49e9cdc4f634ef98c004ec0d967806" }, "downloads": -1, "filename": "pyramid_geoip-0.2.1.tar.gz", "has_sig": false, "md5_digest": "caac413713de0ebd5ca5f0d14f03e00b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8985, "upload_time": "2014-01-28T13:02:52", "url": "https://files.pythonhosted.org/packages/44/6e/006c254befb2a0642ed9984282596e83cd5f2524f173693004ef2b82692b/pyramid_geoip-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "5bdd5f2bc2d2eb65e6b2a637c150455a", "sha256": "90dc2e8f136f432010fff2bda327ab3f1d6e9f55ee4dc2a1527dd0318e0dc5bb" }, "downloads": -1, "filename": "pyramid_geoip-0.2.2.tar.gz", "has_sig": false, "md5_digest": "5bdd5f2bc2d2eb65e6b2a637c150455a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8935, "upload_time": "2014-02-04T12:20:09", "url": "https://files.pythonhosted.org/packages/66/e1/3ca9d64e543b3d039e34a9fcf5c284691d3c7dc50309771ec397bd633a41/pyramid_geoip-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "a2dc711d98c1a97f2b01cf83598b0fc6", "sha256": "2f7e19060a494799e0e0b6b8ecac76605a4c0eef4bebd3e2c5da4781e693993e" }, "downloads": -1, "filename": "pyramid_geoip-0.2.3.tar.gz", "has_sig": false, "md5_digest": "a2dc711d98c1a97f2b01cf83598b0fc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8355, "upload_time": "2014-08-06T09:25:07", "url": "https://files.pythonhosted.org/packages/3e/8a/b4748b4d1c9e8d7e1087c5655d304b455fcdbff33ddbbd2ed5a97562cb3b/pyramid_geoip-0.2.3.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "8394c6040e0ea001cc0ec9cf1567d244", "sha256": "0f4e31f2b146b2f9e2943cdbe87346736700f12fd73bc4b0afa7092a268ca9a2" }, "downloads": -1, "filename": "pyramid_geoip-0.3.tar.gz", "has_sig": false, "md5_digest": "8394c6040e0ea001cc0ec9cf1567d244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7907, "upload_time": "2015-10-06T14:35:46", "url": "https://files.pythonhosted.org/packages/54/6f/bea803587426bdb0851929c65c317252d514bbdf499d59b76a45af5e77a5/pyramid_geoip-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8394c6040e0ea001cc0ec9cf1567d244", "sha256": "0f4e31f2b146b2f9e2943cdbe87346736700f12fd73bc4b0afa7092a268ca9a2" }, "downloads": -1, "filename": "pyramid_geoip-0.3.tar.gz", "has_sig": false, "md5_digest": "8394c6040e0ea001cc0ec9cf1567d244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7907, "upload_time": "2015-10-06T14:35:46", "url": "https://files.pythonhosted.org/packages/54/6f/bea803587426bdb0851929c65c317252d514bbdf499d59b76a45af5e77a5/pyramid_geoip-0.3.tar.gz" } ] }