Generalizing GeoIP to be consumed by more services
This commit is contained in:
30
roles/GeoIP/README.md
Normal file
30
roles/GeoIP/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
Geolocation by IP is a methodology
|
||||
|
||||
# Etymology
|
||||
|
||||
GeoIP is a shortening of geolocation by IP.
|
||||
|
||||
# Relevant Files and Software
|
||||
|
||||
This content is derived & packed by Arch, pulling regularly from [MaxMind](https://maxmind.com).
|
||||
|
||||
# Available Clients
|
||||
|
||||
The Python `geoip2` library can be used with snippets like below:
|
||||
|
||||
```
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import geoip2.database
|
||||
import sys
|
||||
|
||||
with geoip2.database.Reader('/etc/nginx/conf/maxmind-geoip2.mmdb') as reader:
|
||||
response = reader.country(sys.argv[1])
|
||||
print(response.country.iso_code)
|
||||
```
|
||||
|
||||
We also install the `geoiplookup` client from the GeoIP client.
|
||||
|
||||
# Equivalents or Competition
|
||||
|
||||
Whois and other tools can also provide corroboration or alternate responses for these queries.
|
||||
Reference in New Issue
Block a user