Package: ip2l
IP2Location 8.5.1This is a IP2Location Python library that enables the user to find the country, region or state, city, latitude and longitude, ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, and usage type by IP address or hostname originates from. The library reads the geo location information fromIP2Location BIN datafile.Supported IPv4 and IPv6 address.For more details, please visit:https://www.ip2location.com/developers/pythonRequirementsPython 2.2 and aboveInstallationUnzip the package.Execute python setup.py buildExecute python setup.py installorTo install this module type the following (for PyPI):pipinstallIP2LocationUsageYou can check thesample.pyfile to learn more about usage.BIN DatabaseBelow is the description of the functions available in theBIN Databaselookup.Method NameDescriptionopenOpen the IP2Location BIN data for lookup. Default mode: File I/O.closeClose and clean up the file pointer.get_allReturn the geolocation information in array.get_country_shortReturn the ISO3166-1 country code (2-digits) of the IP address.get_country_longReturn the ISO3166-1 country name of the IP address.get_regionReturn the ISO3166-2 region name of the IP address. Please visitISO3166-2 Subdivision Codefor the information of ISO3166-2 supportedget_cityReturn the city name of the IP address.get_latitudeReturn the city latitude of the IP address.get_longitudeReturn the city longtitude of the IP address.get_ispReturn the ISP name of the IP address.get_domainReturn the domain name of IP address.get_zipcodeReturn the zipcode of the city.get_timezoneReturn the UTC time zone (with DST supported).get_netspeedReturn the Internet connection type. Please seeInternet Connection Typefor details.get_idd_codeReturn the IDD prefix to call the city from another country.get_area_codeReturn the area code of the city.get_weather_codeReturn the nearest weather observation station code.get_weather_nameReturn the nearest weather observation station name.get_mccReturn the Mobile Country Codes (MCC).get_mncReturn the Mobile Network Code (MNC).get_mobile_brandCommercial brand associated with the mobile carrier. Please visitMobile Carrier Coverageto view the coverage report.get_elevationReturn average height of city above sea level in meters (m).get_usage_typeReturn the ISP's usage type of IP address. Please seeUsage Typefor details.Web ServiceBelow is the description of the functions available in theWeb Servicelookup.Function NameDescriptionConstructorExpect 3 input parameters:IP2Location API Key.Package (WS1 - WS24)Use HTTPS or HTTPlookupReturn the IP information in array.country_codecountry_nameregion_namecity_namelatitudelongitudezip_codetime_zoneispdomainnet_speedidd_codearea_codeweather_station_codeweather_station_namemccmncmobile_brandelevationusage_typecontinentnamecodehemispheretranslationscountrynamealpha3_codenumeric_codedemonymflagcapitaltotal_areapopulationcurrencycodenamesymbollanguagecodenameidd_codetldtranslationsregionnamecodetranslationscitynametranslationsgeotargetingmetrocountry_groupingstime_zone_infoolsoncurrent_timegmt_offsetis_dstsunrisesunsetget_creditReturn remaining credit of the web service account.Testingpython sample.py
python test.py
python lookup.py <ip_address>Sample BIN DatabasesDownload free IP2Location LITE databases athttps://lite.ip2location.comDownload IP2Location sample databases athttps://www.ip2location.com/developersIPv4 BIN vs IPv6 BINUse the IPv4 BIN file if you just need to query IPv4 addresses.Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.Internet Connection TypeInternet Connection TypeDescriptionDIALDial UpDSLBroadband/Cable/Fiber/MobileCOMPCompany/T1Usage TypeUsage TypeDescriptionCOMCommercialORGOrganizationGOVGovernmentMILMilitaryEDUUniversity/College/SchoolLIBLibraryCDNContent Delivery NetworkISPFixed Line ISPMOBMobile ISPDCHData Center/Web Hosting/TransitSESSearch Engine SpiderRSVReservedSupportEmail:support@ip2location.com.URL:https://www.ip2location.com