Пример #1
0
 def __init__(self, mongodb, dbname=None, plugins=None):     
     if type(mongodb) is str:
         self.db = init_mongodb(mongodb, dbname)
     else:
         self.db = mongodb
     
     if plugins is None:
         self.plugins = {
             'cohort_funnel':CohortFunnel(),
             'action_cohort': ActionCohort(),
             'retention': Retention()
         }
     else:
         self.plugins = plugins
Пример #2
0
    def __init__(self, mysql_uri, mongo_uri, mongo_dbname, tz=pytz.utc):
        result = urlparse(mysql_uri)
        self.mysql_conn = MySQLdb.connect(
            user=result.username,
            passwd= result.password or "",
            db=result.path[1:],
            host= result.hostname,
            port= result.port)

        mongodb = init_mongodb(mongo_uri, mongo_dbname)
        self.actions_api = ActionsApi(mongodb)
        self.import_api = ImportApi(mongodb)

        self.tz = tz

        self.date_format = '%Y-%m-%d %H:%M:%S'
Пример #3
0
    def __init__(self, mongodb, dbname=None):

        if type(mongodb) is str:
            self.db = init_mongodb(mongodb, dbname)
        else:
            self.db = mongodb