In [1]:
cd git/SolarDataRESTfulAPI/


/root/git/SolarDataRESTfulAPI

In [2]:
import pandas
from influxdb import InfluxDBClient
import json
import numpy
from elasticsearch import Elasticsearch
import uuid
from ElasticsearchInterface import ESinterface

In [3]:
import ElasticsearchInterface
reload(ElasticsearchInterface)


Out[3]:
<module 'ElasticsearchInterface' from 'ElasticsearchInterface.pyc'>

In [4]:
es = ElasticsearchInterface.ESinterface()

In [5]:
documentID = "1s22fDTD-QxaocF7Co4_FJt5PDmH_L0cNFtYdWBioITY"
g_id = 992735001
url = "https://docs.google.com/spreadsheets/d/%s/export?gid=%i&exportFormat=csv"%(documentID,g_id)  
print url


https://docs.google.com/spreadsheets/d/1s22fDTD-QxaocF7Co4_FJt5PDmH_L0cNFtYdWBioITY/export?gid=992735001&exportFormat=csv

In [6]:
df = pandas.read_csv(url,sep = ",",skiprows=2, header = 0,index_col = 0 ,na_values = ["     ","    ","  "," ","","-","NAN","#DIV/0!","#VALUE!"])

In [7]:
es.SaveDataFrameAsIndex("solar-area-index",'meta-data',df)


Processing meta for site: 449e6aee-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e7296-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e776e-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e7d4a-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e813c-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e851a-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449e9d7a-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ea180-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ea590-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449eaa22-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449eb364-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449eb8c8-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ebc88-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ec3d6-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ecf20-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449eda38-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ee17c-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 449ef5f4-0141-11e4-a510-f23c9173ce4a
Updated elasticsearch entry
Processing meta for site: 04964558-01f9-11e4-a510-f23c9173ce4a
Updated elasticsearch entry

In [ ]: