def fromhdf5sorted(source, where=None, name=None, sortby=None, checkCSI=False,
                   start=None, stop=None, step=None):
    """
    Provides access to an HDF5 table, sorted by an indexed column, e.g.::

        >>> import petl as etl
        >>> import tables
        >>> # set up a new hdf5 table to demonstrate with
        ... h5file = tables.open_file('example.h5', mode='w', title='Test file')
        >>> h5file.create_group('/', 'testgroup', 'Test Group')
        /testgroup (Group) 'Test Group'
          children := []
        >>> class FooBar(tables.IsDescription):
        ...     foo = tables.Int32Col(pos=0)
        ...     bar = tables.StringCol(6, pos=2)
        ...
        >>> h5table = h5file.create_table('/testgroup', 'testtable', FooBar, 'Test Table')
        >>> # load some data into the table
        ... table1 = (('foo', 'bar'),
        ...           (3, b'asdfgh'),
        ...           (2, b'qwerty'),
        ...           (1, b'zxcvbn'))
        >>> for row in table1[1:]:
        ...     for i, f in enumerate(table1[0]):
        ...         h5table.row[f] = row[i]
        ...     h5table.row.append()
        ...
        >>> h5table.cols.foo.create_csindex()  # CS index is required
        0
        >>> h5file.flush()
        >>> h5file.close()
        >>> #
        ... # access the data, sorted by the indexed column
        ... table2 = etl.fromhdf5sorted('example.h5', '/testgroup', 'testtable',
        ...                             sortby='foo')
        >>> table2
        +-----+-----------+
        | foo | bar       |
        +=====+===========+
        |   1 | b'zxcvbn' |
        +-----+-----------+
        |   2 | b'qwerty' |
        +-----+-----------+
        |   3 | b'asdfgh' |
        +-----+-----------+

    """

    assert sortby is not None, 'no column specified to sort by'
    return HDF5SortedView(source, where=where, name=name,
                          sortby=sortby, checkCSI=checkCSI,
                          start=start, stop=stop, step=step)
Provides access to an HDF5 table, sorted by an indexed column, e.g.::

        >>> import petl as etl
        >>> import tables
        >>> # set up a new hdf5 table to demonstrate with
        ... h5file = tables.open_file('example.h5', mode='w', title='Test file')
        >>> h5file.create_group('/', 'testgroup', 'Test Group')
        /testgroup (Group) 'Test Group'
          children := []
        >>> class FooBar(tables.IsDescription):
        ...     foo = tables.Int32Col(pos=0)
        ...     bar = tables.StringCol(6, pos=2)
        ...
        >>> h5table = h5file.create_table('/testgroup', 'testtable', FooBar, 'Test Table')
        >>> # load some data into the table
        ... table1 = (('foo', 'bar'),
        ...           (3, b'asdfgh'),
        ...           (2, b'qwerty'),
        ...           (1, b'zxcvbn'))
        >>> for row in table1[1:]:
        ...     for i, f in enumerate(table1[0]):
        ...         h5table.row[f] = row[i]
        ...     h5table.row.append()
        ...
        >>> h5table.cols.foo.create_csindex()  # CS index is required
        0
        >>> h5file.flush()
        >>> h5file.close()
        >>> #
        ... # access the data, sorted by the indexed column
        ... table2 = etl.fromhdf5sorted('example.h5', '/testgroup', 'testtable',
        ...                             sortby='foo')
        >>> table2
        +-----+-----------+
        | foo | bar       |
        +=====+===========+
        |   1 | b'zxcvbn' |
        +-----+-----------+
        |   2 | b'qwerty' |
        +-----+-----------+
        |   3 | b'asdfgh' |
        +-----+-----------+