def get_table_metadata ( engine , table ) : metadata = MetaData ( ) metadata . reflect ( bind = engine , only = [ table ] ) table_metadata = Table ( table , metadata , autoload = True ) return table_metadata
python oracle table metadata
Extract all useful infos from the given table
def get_table_metadata(engine, table):
    """ Extract all useful infos from the given table

    Args:
        engine: SQLAlchemy connection engine
        table: table name

    Returns:
        Dictionary of infos
    """
    metadata = MetaData()
    metadata.reflect(bind=engine, only=[table])
    table_metadata = Table(table, metadata, autoload=True)
    return table_metadata