@@ -0,0 +1,1572 @@
+'''%0ACreated on 15.02.2015%0A%0A@author: diesel%0A'''%0A%0Aimport datetime%0Aimport collections%0A%0Afrom IndexEval.fetchdata import FetchData%0Afrom IndexEval.indexdata import IndexData %0Afrom IndexEval.indexrangedata import IndexRangeData%0A%0Adef getNextMonth(startDate):%0A    if startDate.month %3C 12:%0A        return datetime.datetime(startDate.year, startDate.month+1, startDate.day)%0A    else:%0A        return datetime.datetime(startDate.year+1, 1, startDate.day)%0A    %0Adef getIndexMonthlyData( dbName, index, startDate, endDate):%0A    indexRangeList = collections.deque%0A    fetchData = FetchData(dbName, index)%0A    nextDate = getNextMonth(startDate)%0A    %0A    while startDate %3C endDate:%0A        resultList = fetchData.fetchDataByDate(startDate, nextDate)%0A        indexRangeList.append(IndexRangeData.setData(resultList))%0A        startDate=nextDate%0A        nextDate = getNextMonth(startDate)%0A        %0A    return indexRangeList%0A    %0Adef exportMonthlyData( dbName, indexList, startDate, endDate):%0A    indexResultList = collections.deque%0A    %0A    for index in indexList:%0A        indexResultList.append(getIndexMonthlyData(dbName, index, startDate, endDate))%0A%0Aif __name__ == '__main__':%0A    databaseName = 'stockdb'%0A    indexList = %5B'dax',%0A                 'estoxx50',%0A                 'mdax',%0A                 'nasdaq100'%0A                 'nikkei',%0A                 'smi',%0A                 'sp500',%0A                 'tecdax'%5D%0A    startDate = datetime.datetime(1998, 01, 01)%0A    endDate = datetime.datetime.today()%0A    %0A    exportMonthlyData(databaseName, indexList, startDate, endDate)%0A    %0A    %0A    

add calcmonthlydata