Пример #1
0
 def header(self):
     import csv
     from ambry.orm import Table
     
     fn = self.filesystem.download('active1')
     
     with open(fn) as f:
         r = csv.reader(f)
         return [ Table.mangle_name(c) for c in r.next() ]
Пример #2
0
    def inserter(self, table_name, **kwargs):
        from ..database.inserter import ValueInserter
        from sqlalchemy.schema import Table

        table = Table(
            table_name,
            self.metadata,
            autoload=True,
            autoload_with=self.engine)

        return ValueInserter(self, None, table, **kwargs)