Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'url:pypi': 0.03; 'binary': 0.07; 'url:github': 0.09; 'utilizing': 0.09; 'api': 0.11; 'cc:addr :python-list': 0.11; 'python': 0.11; '-tkc': 0.16; 'concert': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'cc:addr:python.org': 0.22; 'url:dev': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'extract': 0.31; 'terms.': 0.31; 'url:python': 0.33; 'there,': 0.34; 'subject:from': 0.34; 'there': 0.35; 'url:org': 0.36; 'being': 0.38; 'sure': 0.39; 'either': 0.39; 'skip:u 10': 0.60; 'city': 0.66; 'blob': 0.84; 'geo': 0.84; 'received:50.22': 0.84; 'subject:Location': 0.84; 'visits': 0.84 Date: Fri, 5 Jul 2013 14:58:09 -0500 From: Tim Chase To: =?UTF-8?B?zp3Or866zr/Pgg==?= Gr33k Subject: Re: Geo Location extracted from visitors ip address In-Reply-To: References: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: none Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373054197 news.xs4all.nl 15953 [2001:888:2000:d::a6]:55006 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50016 On 2013-07-05 22:08, =CE=9D=CE=AF=CE=BA=CE=BF=CF=82 Gr33k wrote: > Is there a way to extract out of some environmental variable the > Geo location of the user being the city the user visits out website > from? >=20 > Perhaps by utilizing his originated ip address? Yep. You can get an 11MB database (17MB uncompressed) http://dev.maxmind.com/geoip/legacy/downloadable/ which you can use to either populate an existing database with the .CSV data there, or use the binary data blob in concert with the Python API https://github.com/maxmind/geoip-api-python # Python + C http://pypi.python.org/pypi/pygeoip/ # pure Python Just be sure to adhere to the licensing terms. -tkc