Skip to content

Google Sheets/Excel to Google maps - make your tasks managable in one map

License

Notifications You must be signed in to change notification settings

DonutByte/TasksToMap

 
 

Repository files navigation

Tasks to Google Maps

Make your tasks managable in one map

Features

  • Input: a csv file that have addresses in a column named Address
  • Output: a csv that have 3 more columns:
-- addresses_found: which address was generated by the api
-- lat - the latitude of the address
-- long - the longitude of the address

Next Features

  • Get the excel directly from google sheets
  • Use Google Maps API to update the map
  • Add option to use existing coordinate in the csv

Installation

Python 3.6+
pip install geopy
pip install pandas

Usage guides

  1. Fill google sheets/ csv file with taksk image

###Must have column named "Address"

  1. Rename the csv "reports.csv"

  2. Run the script. output is "reports_updated.csv"

  3. Create a new google maps image

  4. Click on import (ייבוא)

  5. Select the location columns image

  6. The output is image

Google Colab Usage guides

Create a notebook and add the following commands (or download the notebook in the repo).

Fill the parameter URL, and index if the column name of the address is not "Address".

####Params#####
#google sheet with the tasks:
URL = ''

####Optional Params#####
# the index (starts at 0) where the address column is
# -1 means to look for column which the first cell is 'Address'
ADDRESS_INDEX = -1
# the index (starts at 0) of the worksheet to download
WORKSHEET_INDEX = 0

%cd /content
#!pip install --upgrade -q gspread
%rm -r TasksToMap &> /dev/null
!git clone https://github.com/rangit3/TasksToMap.git

from google.colab import auth
import csv
auth.authenticate_user()

import gspread
from google.auth import default
creds, _ = default()

gc = gspread.authorize(creds)
sheet = gc.open_by_url(URL)
worksheet = sheet.get_worksheet(WORKSHEET_INDEX)
data = worksheet.get_all_values()

with open('/content/TasksToMap/reports.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerows(data)

#upload the input csv into the created folder, and name it as reports.csv
%cd /content/TasksToMap
!pip install -q -r requirements.txt
print("\nCode is running\n")
!python main.py --index {ADDRESS_INDEX}

#copy results to google drive:
from google.colab import drive
drive.mount("/content/drive", force_remount=True)
!cp reports_updated.csv /content/drive/MyDrive

print("\nDone. Search for reports_updated.csv in your drive!")

Licence

The Unlicense

A license with no conditions whatsoever

About

Google Sheets/Excel to Google maps - make your tasks managable in one map

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.4%
  • Jupyter Notebook 19.6%