# Path: dbcollection/core/manager.py
# class CacheManager:
#     """Manage dbcollection configurations and stores them inside a cache file stored in disk.
# 
#     Attributes
#     ----------
#     cache_filename : str
#         Cache file path + name.
#     cache_dir : str
#         Default directory to store all dataset's metadata files.
#     download_dir : str
#         Default save dir path for downloaded data.
#     data : dict
#         Cache contents.
# 
#     """
# 
#     def __init__(self):
#         """Initializes the class."""
#         self.manager = CacheDataManager()
#         self.info = CacheManagerInfo(self.manager)
#         self.dataset = CacheManagerDataset(self.manager)
#         self.task = CacheManagerTask(self.manager)
#         self.category = CacheManagerCategory(self.manager)
# 
#     def info_cache(self):
#         """Prints the information of the cache."""
#         self.info.info()
#         self.dataset.info()
#         self.category.info()
# 
# Path: dbcollection/core/api/metadata.py
# class MetadataConstructor(object):
#     """Manages a dataset's metadata and constructor states.
# 
#     Parameters
#     ----------
#     name : str
#         Name of the dataset.
# 
#     Attributes
#     ----------
#     name : str
#         Name of the dataset.
#     dataset_manager : dict
#         Metadata retrieved from the available datasets database.
# 
#     """
# 
#     def __init__(self, name):
#         """Initialize class."""
#         assert name, "Must input a valid dataset name."
#         self.name = name
#         self.metadata_datasets = self.get_metadata_datasets()
#         self.dataset_manager = self.get_dataset_metadata_from_database(name)
# 
#     def get_metadata_datasets(self):
#         return fetch_list_datasets()
# 
#     def get_dataset_metadata_from_database(self, name):
#         """Returns the metadata and constructor class generator for a dataset."""
#         try:
#             return self.metadata_datasets[name]
#         except KeyError:
#             raise KeyError("Dataset '{}' does not exist in the database.".format(name))
# 
#     def get_default_task(self):
#         """Returns the default task for the dataset."""
#         return self.dataset_manager["default_task"]
# 
#     def parse_task_name(self, task):
#         """Parse the input task string."""
#         assert isinstance(task, str), "Must input a string as a valid task name."
#         if task == '':
#             task_parsed = self.get_default_task()
#         elif task == 'default':
#             task_parsed = self.get_default_task()
#         else:
#             task_parsed = task
#         return task_parsed
# 
#     def get_tasks(self):
#         """Returns the available tasks of the dataset."""
#         return self.dataset_manager["tasks"]
# 
#     def get_keywords(self, task):
#         """Get the keywords for a task of a dataset."""
#         pass
# 
#     def get_constructor(self):
#         """Returns the constructor class to generate the dataset's metadata."""
#         return self.dataset_manager["constructor"]


import os
from dbcollection.core.manager import CacheManager
from .metadata import MetadataConstructor
        Name of the dataset.
    task : str
        Name of the task to process.
    verbose : bool
        Displays text information (if true).
    extract_data : bool
        Flag to extract data (if True).
    cache_manager : CacheManager
        Cache manager object.

    Raises
    ------
    KeyError
        If a task does not exist for a dataset.

    """

    def __init__(self, name, task, verbose):
        """Initialize class."""
        assert isinstance(name, str), 'Must input a valid dataset name.'
        assert isinstance(task, str), 'Must input a valid task name.'
        assert isinstance(verbose, bool), "Must input a valid boolean for verbose."

        self.name = name
        self.task = task
        self.verbose = verbose
        self.extract_data = False
        self.cache_manager = self.get_cache_manager()

    def get_cache_manager(self):

# Path: dbcollection/core/manager.py
# class CacheManager:
#     """Manage dbcollection configurations and stores them inside a cache file stored in disk.
# 
#     Attributes
#     ----------
#     cache_filename : str
#         Cache file path + name.
#     cache_dir : str
#         Default directory to store all dataset's metadata files.
#     download_dir : str
#         Default save dir path for downloaded data.
#     data : dict
#         Cache contents.
# 
#     """
# 
#     def __init__(self):
#         """Initializes the class."""
#         self.manager = CacheDataManager()
#         self.info = CacheManagerInfo(self.manager)
#         self.dataset = CacheManagerDataset(self.manager)
#         self.task = CacheManagerTask(self.manager)
#         self.category = CacheManagerCategory(self.manager)
# 
#     def info_cache(self):
#         """Prints the information of the cache."""
#         self.info.info()
#         self.dataset.info()
#         self.category.info()
# 
# Path: dbcollection/core/api/metadata.py
# class MetadataConstructor(object):
#     """Manages a dataset's metadata and constructor states.
# 
#     Parameters
#     ----------
#     name : str
#         Name of the dataset.
# 
#     Attributes
#     ----------
#     name : str
#         Name of the dataset.
#     dataset_manager : dict
#         Metadata retrieved from the available datasets database.
# 
#     """
# 
#     def __init__(self, name):
#         """Initialize class."""
#         assert name, "Must input a valid dataset name."
#         self.name = name
#         self.metadata_datasets = self.get_metadata_datasets()
#         self.dataset_manager = self.get_dataset_metadata_from_database(name)
# 
#     def get_metadata_datasets(self):
#         return fetch_list_datasets()
# 
#     def get_dataset_metadata_from_database(self, name):
#         """Returns the metadata and constructor class generator for a dataset."""
#         try:
#             return self.metadata_datasets[name]
#         except KeyError:
#             raise KeyError("Dataset '{}' does not exist in the database.".format(name))
# 
#     def get_default_task(self):
#         """Returns the default task for the dataset."""
#         return self.dataset_manager["default_task"]
# 
#     def parse_task_name(self, task):
#         """Parse the input task string."""
#         assert isinstance(task, str), "Must input a string as a valid task name."
#         if task == '':
#             task_parsed = self.get_default_task()
#         elif task == 'default':
#             task_parsed = self.get_default_task()
#         else:
#             task_parsed = task
#         return task_parsed
# 
#     def get_tasks(self):
#         """Returns the available tasks of the dataset."""
#         return self.dataset_manager["tasks"]
# 
#     def get_keywords(self, task):
#         """Get the keywords for a task of a dataset."""
#         pass
# 
#     def get_constructor(self):
#         """Returns the constructor class to generate the dataset's metadata."""
#         return self.dataset_manager["constructor"]


# Path: dbcollection/core/api/process.py
import os
from dbcollection.core.manager import CacheManager
from .metadata import MetadataConstructor

        Name of the dataset.
    task : str
        Name of the task to process.
    verbose : bool
        Displays text information (if true).
    extract_data : bool
        Flag to extract data (if True).
    cache_manager : CacheManager
        Cache manager object.

    Raises
    ------
    KeyError
        If a task does not exist for a dataset.

    """

    def __init__(self, name, task, verbose):
        """Initialize class."""
        assert isinstance(name, str), 'Must input a valid dataset name.'
        assert isinstance(task, str), 'Must input a valid task name.'
        assert isinstance(verbose, bool), "Must input a valid boolean for verbose."

        self.name = name
        self.task = task
        self.verbose = verbose
        self.extract_data = False
        self.cache_manager = self.get_cache_manager()

    def get_cache_manager(self):

        return CacheManager()