Coder Social home page Coder Social logo

python-script's Introduction

Travel time calculator

Hello! Command-line lover, who wants to use the web browser to know how long it will take between two locations when you have this great command-line script to do that? Nobody, right? Congratulations, you will no longer need to leave your beloved terminal for this.

What does the script do?

The script calculates the time it will take you to go from location A to location B. You can choose between bicycling, driving or walking.

Installing the dependencies

googlemaps package

This script require the googlemaps package. To install this package, do:

$> pip3 install googlemaps

If you have any issues with permission, consider using sudo.

Getting your GoogleMaps API key

From your browser

Visit the google maps direction API website and click on get a key on the top right corner. Then follow the instructions and copy your key into the script here:

# (API key) : Google maps API key
GOOGLE_MAP_API_KEY = 'myawsomeapikey'

From your console

  • Go to the Google API Console.

  • Create or select a project.

  • Click Continue to enable the API and any related services.

  • On the Credentials page, get an API key. Note: If you have an existing unrestricted API key, or a key with browser restrictions, you may use that key.

  • From the dialog displaying the API key, select Restrict key to set a browser restriction on the API key.

  • In the Key restriction section, select HTTP referrers (web sites), then follow the on-screen instructions to set referrers.

How to use it

First, clone this repository:

$> git clone https://github.com/RaiVaibhav/python-script.git
$> cd python-script/

Then:

$> python3 Get_travel_time_between_two_location.py

python-script's People

Contributors

himanshi-khandelwal avatar johnroper100 avatar knightking100 avatar n0zg avatar naveenyadav15 avatar raivaibhav avatar random-hacktoberfest-participant-2017 avatar

Watchers

 avatar

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.