# Path: pandasdmx/util.py
# def parse_content_type(value: str) -> Tuple[str, Dict[str, Any]]:
#     """Return content type and parameters from `value`.
# 
#     Modified from :mod:`requests.util`.
#     """
#     tokens = value.split(";")
#     content_type, params_raw = tokens[0].strip(), tokens[1:]
#     params = {}
#     to_strip = "\"' "
# 
#     for param in params_raw:
#         k, *v = param.strip().split("=")
# 
#         if not k and not v:
#             continue
# 
#         params[k.strip(to_strip).lower()] = v[0].strip(to_strip) if len(v) else True
# 
#     return content_type, params


from pathlib import Path
from abc import ABC, abstractmethod
from functools import lru_cache
from typing import List
from pandasdmx.util import parse_content_type
    import appdirs
import logging
except ImportError:
    pass



log = logging.getLogger(__name__)


class BaseReader(ABC):
    #: List of HTTP content types handled by the reader.
    content_types: List[str] = []

    #: List of file name suffixes handled by the reader.
    suffixes: List[str] = []

    @classmethod
    def detect(cls, content: bytes) -> bool:
        """Detect whether the reader can handle `content`.

        Returns
        -------
        bool
            :obj:`True` if the reader can handle the content.
        """
        return False

    @classmethod
    @lru_cache()
    def supports_content_type(cls, value: str) -> bool:
        """:obj:`True` if the reader can handle content/media type `value`."""

# Path: pandasdmx/util.py
# def parse_content_type(value: str) -> Tuple[str, Dict[str, Any]]:
#     """Return content type and parameters from `value`.
# 
#     Modified from :mod:`requests.util`.
#     """
#     tokens = value.split(";")
#     content_type, params_raw = tokens[0].strip(), tokens[1:]
#     params = {}
#     to_strip = "\"' "
# 
#     for param in params_raw:
#         k, *v = param.strip().split("=")
# 
#         if not k and not v:
#             continue
# 
#         params[k.strip(to_strip).lower()] = v[0].strip(to_strip) if len(v) else True
# 
#     return content_type, params


# Path: pandasdmx/reader/base.py
from pathlib import Path
from abc import ABC, abstractmethod
from functools import lru_cache
from typing import List
from pandasdmx.util import parse_content_type
    import appdirs
import logging

except ImportError:
    pass



log = logging.getLogger(__name__)


class BaseReader(ABC):
    #: List of HTTP content types handled by the reader.
    content_types: List[str] = []

    #: List of file name suffixes handled by the reader.
    suffixes: List[str] = []

    @classmethod
    def detect(cls, content: bytes) -> bool:
        """Detect whether the reader can handle `content`.

        Returns
        -------
        bool
            :obj:`True` if the reader can handle the content.
        """
        return False

    @classmethod
    @lru_cache()
    def supports_content_type(cls, value: str) -> bool:
        """:obj:`True` if the reader can handle content/media type `value`."""

        other = parse_content_type(value)