import commands
import utility.device_master as dev_master
import utility.html_table as html_table
import utility.mail_util as mail_util
import math
import utility.date_func as date_func
import utility.html as html_util
import utility.google_chart_api as gchart

argvs = sys.argv
end = int(argvs[1])
summary_app_name = 'kidsnbooks'
if len(argvs) > 2:
     summary_app_name = argvs[2]

start = date_func.ndaysago(end, 100)
yyyymmdd, yyyymm, yyyy, mm, dd = date_func.get_yyyymmdd(end)
date_end = yyyy + "-" + str('%02d' % int(mm)) + "-" + str('%02d' % int(dd))
yyyymmdd, yyyymm, yyyy, mm, dd = date_func.get_yyyymmdd(start)
date_start = yyyy + "-" + str('%02d' % int(mm)) + "-" + str('%02d' % int(dd))



from_addr = '*****@*****.**'
to_addrs = ['*****@*****.**', '*****@*****.**']
#to_addrs = ['*****@*****.**']
list = ['kidsnbooks', 'rhythmtap', 'rhythmtapplus', 'rhythmetv', 'kdmode',
        'rhythm', 'rhythmplus', 'rhythmonstage', 'goccozoo']
allinone_tab = {}
#後でメールの文章を入れる
t = "サービス詳細KPIレポート" + "(" + str(end) + ")"
Esempio n. 2
0
#/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.path.append('/home/takagi/git/analytics/analytics_tool')
import utility.db_utility as db_util
from datetime import datetime as dt
import datetime
import commands
import utility.device_master as dev_master
import utility.date_func as date_func

argvs = sys.argv
install_date = int(argvs[1].replace("-", ""))
d007 = date_func.ndaysago(install_date, -7)
d014 = date_func.ndaysago(install_date, -14)
d035 = date_func.ndaysago(install_date, -35)
d060 = date_func.ndaysago(install_date, -60)
d100 = date_func.ndaysago(install_date, -100)
d180 = date_func.ndaysago(install_date, -180)
d370 = date_func.ndaysago(install_date, -370)
d730 = date_func.ndaysago(install_date, -730)

user_data = {}
#DB
db = {
    "meta"   : { "server" : "inhousedb.smartsrv.in",
                 "db_name" : "statistics",
                 "table" : ["mnl_metalog_light_fast"],
                 "colum" : "*"
                 },
Esempio n. 3
0
sys.path.append('/home/takagi/git/analytics/analytics_tool')
import utility.db_utility as db_util
from datetime import datetime as dt
import datetime
import commands
import utility.device_master as dev_master
import utility.html_table as html_table
import utility.mail_util as mail_util
import math
import utility.date_func as date_func
import utility.html as html_util
import utility.google_chart_api as gchart

argvs = sys.argv
day01 = int(argvs[1])
day03 = date_func.ndaysago(day01, 2)
day07 = date_func.ndaysago(day01, 6)
day30 = date_func.ndaysago(day01, 29)
day60 = date_func.ndaysago(day01, 59)
day90 = date_func.ndaysago(day01, 89)

from_addr = '*****@*****.**'
#to_addrs = ['*****@*****.**', '*****@*****.**']
to_addrs = ['*****@*****.**']



html = ""
doc = html_util.document()

#売上
from datetime import datetime as dt
import commands
import utility.device_master as dev_master
import utility.easy_access as ea
import utility.date_func as df

argvs = sys.argv
lower = 20130625
#DB

#課金した日の取得
data = ea.first_subscription("kidsnbooks", 20130625, 20130930)

#本データ
for i in range(110):
    date = df.ndaysago(lower, -i)
    b = ea.kidsnbooks_booklog(date)
    for uid, d in data.items():
        data[uid].setdefault("book_id", None)
        data[uid].setdefault("book_name", None)
        data[uid].setdefault("date", None)
        if b.has_key(uid):
            if d["date"] == None or (d["date"] > b[uid]["start"] and b[uid]["start"] >= d["subdate"]):
                data[uid]["date"] = b[uid]["start"]
                data[uid]["book_id"] = b[uid]["book_id"]
                data[uid]["book_name"] = b[uid]["book_name"]
                


#summary
summary = {}
Esempio n. 5
0
import commands
import utility.device_master as dev_master
import utility.html_table as html_table
import utility.mail_util as mail_util
import math
import utility.date_func as date_func
import utility.html as html_util
import utility.google_chart_api as gchart

argvs = sys.argv
end = int(argvs[1])
summary_app_name = 'kidsnbooks'
if len(argvs) > 2:
     summary_app_name = argvs[2]

start = date_func.ndaysago(end, 90)
yyyymmdd, yyyymm, yyyy, mm, dd = date_func.get_yyyymmdd(end)
date_end = yyyy + "-" + str('%02d' % int(mm)) + "-" + str('%02d' % int(dd))
yyyymmdd, yyyymm, yyyy, mm, dd = date_func.get_yyyymmdd(start)
date_start = yyyy + "-" + str('%02d' % int(mm)) + "-" + str('%02d' % int(dd))



from_addr = '*****@*****.**'
to_addrs = ['*****@*****.**', '*****@*****.**']
#to_addrs = ['*****@*****.**']

title = ''
app_analyze = {}
if summary_app_name == 'kidsnbooks':
     title = 'スマほん'