Real time customer data analysis platform with results in geo-location clusters mapped on KML file (can be viewed in Google Maps)
1. Clone this repository
2. Run `pip install -r requirements.txt`
3. Application is ready to be used. See Usage section.
solanki@bhavya:~/NOKIA/Clustomer$ python3 app.py --flask
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
solanki@bhavya:~/NOKIA/Clustomer$ python3 app.py -h
usage: app.py [-h] (-flask | -clu) [-k KML] [-x XLSX] [-c CLUSTERS]
Clustomer: Clustering customers onto a map in KML given a geo-location in Excel data format
optional arguments:
-h, --help show this help message and exit
-flask, --flask Run flask app
-clu, --clu Use command line utility
-k KML, --kml KML Geolocation map in kml format
-x XLSX, --xlsx XLSX Data of customers in excel format
-c CLUSTERS, --clusters CLUSTERS
Number of clusters
>>> import logging
>>> logging.basicConfig(filename="somefile.log", level=logging.DEBUG)
>>> logger = logging.getLogger('LOG')
>>>
>>> from algo import *
>>> data = {
... "data_file_path": "f1.xlsx",
... "kml_file_path": "f2.kml",
... "number_of_clusters": 5
... }
>>> logic = cluster.Logic(args.xlsx, query={}, logger=logger)
>>> c = coloring.ColorKML(data, logger=logger, logic=logic, process=True)
[*] File saved as updated_f2.kml
Note: Look into documentation to know how to gain more manual control with process=False
-
Look in the Logs: Look in
/logs
folder for the most recent log. The log-files are in a format asYYYY-MM-DD HH-MM-logfile.log
, i.e., as an example:2019-07-10 11-46-logfile.log
. -
If logic halts and application misbehaves, feel free to drop a mail here, with a subject starting from
CLUSTOMER ISSUE: <>
. I would be glad to solve it.
-
KML files can be viewed in Google-Earth PRO
- Here is how to download google earth:
- Download GEP from here.
- Double-click the file and follow the installation process.
- To open GEP, click Start and then Programs and then Google Earth Pro. Then, click Google Earth Pro.
- Here is how to download google earth:
-
View it online: This website would work.
Note: KML files can also be viewed in Google-maps