docs: def map_package_to_dataset(package, portal_url):
      """Mapea un diccionario con metadatos de cierto 'package' de CKAN a un
      diccionario con metadatos de un 'dataset' según el estándar data.json."""
      dataset = dict()
      resources = package["resources"]
      groups = package["groups"]
      tags = package["tags"]
  
      dataset_mapping = {
          'title': 'title',
          'notes': 'description',
          'metadata_created': 'issued',
          'metadata_modified': 'modified',
          'license_title': 'license',
          'id': 'identifier',
          'url': 'landingPage'
      }
  
      for package_key, dataset_key in iteritems(dataset_mapping):
          try:
              dataset[dataset_key] = package[package_key]
          except BaseException:
              logger.exception("""
              La clave '%s' no está en el endpoint 'package_show' para el
              package '%s'. No se puede completar dataset['%s'].""",
                               package_key, package['name'], dataset_key)
  
      publisher_mapping = {
          'author': 'name',
          'author_email': 'mbox'
      }
  
      if any([k in package for k in publisher_mapping.keys()]):
          dataset["publisher"] = dict()
          for package_key, publisher_key in iteritems(publisher_mapping):
              try:
                  dataset['publisher'][publisher_key] = package[package_key]
              except BaseException:
                  logger.exception("""
                  La clave '%s' no está en el endpoint 'package_show' para el
                  package '%s'. No se puede completar
                  dataset['publisher']['%s'].""",
                                   package_key, package['name'], publisher_key)
  
      contact_point_mapping = {
          'maintainer': 'fn',
          'maintainer_email': 'hasEmail'
      }
  
      if any([k in package for k in contact_point_mapping.keys()]):
          dataset["contactPoint"] = dict()
          for package_key, contact_key in iteritems(contact_point_mapping):
              try:
                  dataset['contactPoint'][contact_key] = package[package_key]
              except BaseException:
                  logger.exception("""
                  La clave '%s' no está en el endpoint 'package_show' para el
                  package '%s'. No se puede completar
                  dataset['contactPoint']['%s'].""",
                                   package_key, package['name'], contact_key)
  
      # Si existen campos extras en la información del package, busco las claves
      # "Frecuencia de actualización" y "Temática global" para completar los
      # campos "accrualPeriodicity" y "superTheme" del dataset, respectivamente.
      if "extras" in package:
          add_accrualPeriodicity(dataset, package)
          add_superTheme(dataset, package)
          add_temporal(dataset, package)
  
      dataset["distribution"] = map_resources_to_distributions(resources,
                                                               portal_url)
      dataset["theme"] = [grp['name'] for grp in groups]
      dataset['keyword'] = [tag['name'] for tag in tags]
  
      return dataset