iplocation.local 1.0.0

A quick package to perform IP geolocation lookups using ip2location.com databases.

Install-Package iplocation.local -Version 1.0.0
dotnet add package iplocation.local --version 1.0.0
<PackageReference Include="iplocation.local" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add iplocation.local --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

iplocation

This is a small and fast library that will import a geolocation database from IP2LOCATION into sqlite and provide a quick package to lookup IP address locations.

Installation

Usage

You need to register at ip2location.com and download one of the databases they provide. This code is made to parse the CSV version of the ip2location-lite-db5 database. This database will provide accuracy up to the city level, as well as latitude and longitude.

Once you have the ip2location-lite-db5.csv file on your computer, run this code to import it into a sqlite DB that will be used later for querying:

IpLocation.ImportIpLocationCsv(ipLocationCsv, ipLocationDb);

It will take a minute, it's processing around 3M records. You only need to do this once. It will generate a sqlite file with the parsed contents of the CSV file.

To query an IP address:

using (var ipl = new IpLocation(ipLocationDb))
{
    var result = ipl.GetIpLocation("8.8.8.8");

    Console.WriteLine(result);
}

You can check the "example" project for a full example.

iplocation

This is a small and fast library that will import a geolocation database from IP2LOCATION into sqlite and provide a quick package to lookup IP address locations.

Installation

Usage

You need to register at ip2location.com and download one of the databases they provide. This code is made to parse the CSV version of the ip2location-lite-db5 database. This database will provide accuracy up to the city level, as well as latitude and longitude.

Once you have the ip2location-lite-db5.csv file on your computer, run this code to import it into a sqlite DB that will be used later for querying:

IpLocation.ImportIpLocationCsv(ipLocationCsv, ipLocationDb);

It will take a minute, it's processing around 3M records. You only need to do this once. It will generate a sqlite file with the parsed contents of the CSV file.

To query an IP address:

using (var ipl = new IpLocation(ipLocationDb))
{
    var result = ipl.GetIpLocation("8.8.8.8");

    Console.WriteLine(result);
}

You can check the "example" project for a full example.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 141 3/12/2020