Communicating your location can be hard, and can only be so accurate. Longitude and latitude can be used to relay ones location to a tee, but remembering exact longtitude and latitude values is hard enough, and to pass them to someone else would prove to be even harder.
The Open Location Code system is a geocode system that can also be used to identify an area anywhere on earth. This system provides codes that can narrow a location down to 3.5m by 3.5m distances. However, one pitfall to this system is the hard to remember strings - for example, 849VCWC8+R9.
Where Am I aims to solve this problem by converting the strings into a memorable four-to-five word phrase.
tl;dr - need to relay your location? longitude and latitude, Open Location Code, Where Am I ✔️
First, you'll need to setup the main whereamigeo
Python package first as both the web application and CLI tool depend on it.
-
Create a virtualenv and initialize it; this may vary depending on your operating system. Setup the virtualenv in the root of the project.
$ virtualenv env && source env/bin/activate
-
Install dependencies for the project.
$ pip install -r requirements.txt
-
Install the pre-commit hooks. This runs linting before every commit.
$ pre-commit install
-
cd
into thewhereamigeo
directory.$ cd whereamigeo
-
Install the package locally.
$ pip install .
Make sure you've completed the general setup before starting this!
-
cd
into theweb
directory. This is where the files for the web app live.$ cd web
-
Run the app with the following:
$ export FLASK_APP=main.py && flask run
This should start Flask. You can then view the website at localhost:5000!
Make sure you've completed the general setup before starting this!
-
Run the CLI as a package by using the
-m
flag when executingpython
. You'll first need tocd
out of thecli
directory.$ cd ..
-
Then, run the CLI package using Python.
$ python -m cli.main <args>
If you've done the general setup, then this should be setup properly.
-
Keep in mind, every time you make a change to the files under
whereamigeo/
, you'll need to reinstall the package for the changes to take place.$ cd whereamigeo $ pip install .
Not much setup is needed for the Discord functionality to work - as long as you ran the requirements.txt file earlier, you'll have the dependencies needed.
-
On line 27, replace the
INSERT-TOKEN-HERE
with your Discord token. Run the command and it'll start up!$ python bot.py