A python module that calculates efficient delivery routes and displays them in Google Maps so you can review, edit, print, and share them with delivery truck drivers.
DeliveryLogistics is licensed under the Apache License. Version 2.0, January 2004. Please see the attched LICENSE.txt file.
The first step to installing and running DeliveryLogistics is to be sure that Python 3 is installed on your computer. If you are planning to use this program on your work computer, then please consult your system administrator or IT department for assistance installing Python 3.
To determine if Python 3 is already installed on your computer, open a command line terminal, type the following, and press Enter:
python3 --version
If Python 3 is already installed then you will see the following displayed (the actual numbers may be different, depending upon the version of Python that is installed on your computer):
Python 3.10.6
Otherwise, please proceed to https://www.python.org/downloads/ to download a copy of Python 3 and obtain installation instructions for Python.
Once Python is installed on your computer you can download DeliveryLogistics by navitating to this repository https://github.com/herrsmitty8128/DeliveryLogistics, clicking on the green Code drop-down menu, and then clicking on Download Zip.
Then download the zip file to a local directory of your choosing, where you should then extract everything in the zip file. Once the files are extracted and Python 3 is installed. You should proceed to the Dependencies section below.
Most of the Python modules required by DeliveryLogistics are included with Python. However, there is a short list of exceptions below:
- numpy (see https://pypi.org/project/numpy/ for more information)
- googlemaps (see https://pypi.org/project/googlemaps/ for more information)
These modules must be installed to use DeliveryLogistics. You can install these packages by opening a command line terminal, typing the following command, and pressing Enter:
python3 -m pip install numpy googlemaps
On Linux, if you are not logged in as a root user then be sure to prepend the commands above with sudo.
DeliveryLogistics is designed to be used in one of two ways:
- Obtain distances and drive times from the Google Maps API and calculate efficient routes.
- Recalculate drive times from a previously saved file.
DeliveryLogistics uses Google Maps to obtain the driving time between every combination of delivery location and distribution center(s). In order for the program to access the Google Maps API online, you must give it your Google Maps API Key. If you do not already have one, then you can obtain one here https://developers.google.com/maps/documentation/javascript/get-api-key.
In order to calculate efficient delivery routes, DeliveryLogistics must know the full address and number of packages for each customer. This information is provided to the program at run-time through the use of a file in CSV format. The CSV file must contain all of the following fields:
- "address": The customer's full delivery address. The address must be surrounded by quotation marks.
- "bags": The number of packages to deliver to the customer's address. Quotation marks are not needed.
An example of a properly formated CSV file is below. Most popular spreadsheet applications support CSV format and can be used to create the file.
address,bags
"123 Main Street, City Name, State 12345", 15
"321 Maple Lane, City Name, State 09384", 5
"4321 My Street, City Name, State 54321", 9