8000 GitHub - life-in-messiah/freegeoip: Pythonic wrapper around the freegeoip web service
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

life-in-messiah/freegeoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freegeoip Build Status

Pythonic wrapper around the freegeoip web service

Installation

Using pip NOT IMPLEMENTED YET: For now, download and then put freegeoip.py in your PATH

Usage

(Python 3 syntax)

from freegeoip
616E
 import fetch

# to fetch using the system IP
local_data = fetch()

# to fetch using a manually-entered IP
manual_data = fetch(ip="72.160.61.110")

# to fetch using a different server
server_data = fetch(server="http://freegeoip.mywebservice.com")

fetch() returns a data structure upon success or throws an Exception upon failure. If we looked into the variable local_data from the above example, the available data would be as follows:

local_data.country_name # Ex. "United States"
local_data.region_code  # Ex. "Montana"
local_data.city         # Ex. "Kalispell"
local_data.zip_code     # Ex. "59901"
local_data.latitude     # Ex. 48.1987
local_data.longitude    # Ex. -114.3857
local_data.metro_code   # Ex. 762
local_data.time_zone    # Ex. "America/Denver"

About

Pythonic wrapper around the freegeoip web service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0