Installing

With GeoIP

Then you’ll need to download a MaxMind free GeoIP2 database, unzip it and set the GEOIP2_FILE environment variable to point to it.

With Core Location

However, on OS X 10.6 (Snow Leopard) or later, you can also use the much more accurate Core Location framework:

$ pip install doko[corelocation]

The corelocation dependencies take much longer to install, so go make a coffee. In fact, make several coffees.

Once you’ve installed the corelocation-enabled doko package, you’ll need to enable Core Location in System Preferences, in the “Security” or “Security & Privacy” section. Furthermore, you must be using Wifi for it to work.

Hacking

For hacking on OSX, you will likely want to install requires-corelocation.txt as well as requires.txt.

Run the tests with make test.

Using on the command-line

Just run the doko command:

$ doko
35.674,139.701

This will give its best guess as to your location, depending on the strategies that are available. Use the --show option to open the location in Google Maps.

More fine-grained control over strategies used and the precision returned is available. See doko --help.

Landmarks

You can use the doko-landmark command to store known landmarks, which you can then specify to doko using the DOKO_LANDMARK environment variable. This is useful if you’re somewhere you go often without GPS: