Coder Social home page Coder Social logo

rangit3 / taskstomap Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 36 KB

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

License: The Unlicense

Python 83.10% Jupyter Notebook 16.90%
google-maps maps task-management task-manager tasks-list

taskstomap's Introduction

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

Advanced Features

  • Get the excel directly from google sheets.
  • Tasks can be added to the google sheet automatically via Google Forms or other application.
  • Use Google Colab for full pipeline without any installations
  • Use Google Maps API to update the map

Installation

Python 3.6+
pip install -q -r requirements.txt

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

# Fixing the csv: There are additional parameters to fix the csv.
# Fill Cells: An option to fill the csv with default values per column. For example: !python main.py --index {ADDRESS_INDEX} --fill_pairs Status=חדש,Name=אנונימי
# Ignore Lines: An option to ignore lines with specific values inside a cell. For example: !python main.py --index {ADDRESS_INDEX} --ignore_pairs Status=נמסר

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

####Run The Code#####
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}

####Save the 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, except terrorists.

taskstomap's People

Contributors

donutbyte avatar noamavid1 avatar rangit3 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

taskstomap's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.