def get_schema(url, typename, version='1.0.0', timeout=30):
    """Parses DescribeFeatureType response and creates schema compatible
    with :class:`fiona`

    :param str url: url of the service
    :param str version: version of the service
    :param str typename: name of the layer
    :param int timeout: request timeout
    """

    url = _get_describefeaturetype_url(url, version, typename)
    res = openURL(url, timeout=timeout)
    root = etree.fromstring(res.read())
    type_element = findall(root, '{%s}element' % XS_NAMESPACE,
                           attribute_name='name', attribute_value=typename)[0]
    complex_type = type_element.attrib['type'].split(":")[1]
    elements = _get_elements(complex_type, root)
    nsmap = None
    if hasattr(root, 'nsmap'):
        nsmap = root.nsmap
    return _construct_schema(elements, nsmap)
dataset/ETHPy150Open geopython/OWSLib/owslib/feature/schema.py/get_schema/original