def __init__(self, database_file):
        '''
        :param database_file: Path to the sqlite database
        '''
        self._database_file = 'sqlite:///' + database_file

        self._engine = create_engine(self._database_file)

        if not database_exists(self._database_file):
            self._init_database()

        self._Base = automap_base()
        self._Base.prepare(self._engine, reflect=True)
        self.session = Session(sessionmaker(bind=self._engine))

        self.tables = self._Base.classes

        class ArchiveSchema(ModelSchema):
            class Meta:
                model = self.tables.archive

        self.archive_schema = ArchiveSchema()
def __init__ ( self , database_file ) : self . _database_file = 'sqlite:///' + database_file self . _engine = create_engine ( self . _database_file ) if not database_exists ( self . _database_file ) : self . _init_database ( ) self . _Base = automap_base ( ) self . _Base . prepare ( self . _engine , reflect = True ) self . session = Session ( sessionmaker ( bind = self . _engine ) ) self . tables = self . _Base . classes class ArchiveSchema ( ModelSchema ) : class Meta : model = self . tables . archive self . archive_schema = ArchiveSchema ( )
:param database_file: Path to the sqlite database