diff --git a/docs/MANUAL.md b/docs/MANUAL.md
index 556645c..2191b01 100644
--- a/docs/MANUAL.md
+++ b/docs/MANUAL.md
@@ -94,6 +94,8 @@ Toma los siguientes parámetros:
   - **portal_url**: URL del portal de CKAN de destino.
   - **apikey**: La apikey de un usuario del portal de destino con los permisos para crear el dataset bajo la
   organización pasada como parámetro.
+  - **demote_themes** (opcional, default: True): Si está en true, los labels de los themes del dataset, se escriben como
+  tags de CKAN; sino,se pasan como grupo.
   
   Retorna el id en el nodo de destino del dataset federado.
   
diff --git a/pydatajson/ckan_utils.py b/pydatajson/ckan_utils.py
index 65c4cb2..31f6737 100644
--- a/pydatajson/ckan_utils.py
+++ b/pydatajson/ckan_utils.py
@@ -14,7 +14,7 @@ def append_attribute_to_extra(package, dataset, attribute, serialize=False):
         package['extras'].append({'key': attribute, 'value': value})
 
 
-def map_dataset_to_package(dataset, catalog_id):
+def map_dataset_to_package(dataset, catalog_id, owner_org, theme_taxonomy, demote_themes=True):
     package = dict()
     package['extras'] = []
 #   Obligatorios
@@ -24,6 +24,7 @@ def map_dataset_to_package(dataset, catalog_id):
     package['private'] = False
     package['notes'] = dataset['description']
     package['author'] = dataset['publisher']['name']
+    package['owner_org'] = owner_org
 
     append_attribute_to_extra(package, dataset, 'issued')
     append_attribute_to_extra(package, dataset, 'accrualPeriodicity')
@@ -44,7 +45,6 @@ def map_dataset_to_package(dataset, catalog_id):
     append_attribute_to_extra(package, dataset, 'language', serialize=True)
 
     spatial = dataset.get('spatial')
-
     if spatial:
         serializable = type(spatial) is list
         append_attribute_to_extra(package, dataset, 'spatial', serializable)
@@ -58,6 +58,16 @@ def map_dataset_to_package(dataset, catalog_id):
     if keywords:
         package['tags'] = [{'name': keyword} for keyword in keywords]
 
+    # Move themes to keywords
+    themes = dataset.get('theme', [])
+    if themes and demote_themes:
+        package['tags'] = package.get('tags', [])
+        for theme in themes:
+            label = next(x['label'] for x in theme_taxonomy if x['id'] == theme)
+            package['tags'].append({'name': label})
+    else:
+        package['groups'] += [{'name': title_to_name(theme, decode=False)} for theme in themes]
+
     return package
 
 
diff --git a/pydatajson/federation.py b/pydatajson/federation.py
index a8f137f..f9a4f6b 100644
--- a/pydatajson/federation.py
+++ b/pydatajson/federation.py
@@ -9,7 +9,8 @@ from .ckan_utils import map_dataset_to_package
 from .search import get_datasets
 
 
-def push_dataset_to_ckan(catalog, catalog_id, owner_org, dataset_origin_identifier, portal_url, apikey):
+def push_dataset_to_ckan(catalog, catalog_id, owner_org, dataset_origin_identifier, portal_url, apikey,
+                         demote_themes=True):
     """Escribe la metadata de un dataset en el portal pasado por parámetro.
 
         Args:
@@ -19,15 +20,17 @@ def push_dataset_to_ckan(catalog, catalog_id, owner_org, dataset_origin_identifi
             dataset_origin_identifier (str): El id del dataset que se va a federar.
             portal_url (str): La URL del portal CKAN de destino.
             apikey (str): La apikey de un usuario con los permisos que le permitan crear o actualizar el dataset.
+            demote_themes(bool): Si está en true, los labels de los themes del dataset, pasan a ser tags. Sino,
+            se pasan como grupo.
 
         Returns:
             str: El id del dataset en el catálogo de destino.
     """
     dataset = catalog.get_dataset(dataset_origin_identifier)
     ckan_portal = RemoteCKAN(portal_url, apikey=apikey)
+    theme_taxonomy = catalog.themes
 
-    package = map_dataset_to_package(dataset, catalog_id)
-    package['owner_org'] = owner_org
+    package = map_dataset_to_package(dataset, catalog_id, owner_org, theme_taxonomy, demote_themes=demote_themes)
 
     # Get license id
     if dataset.get('license'):
@@ -42,15 +45,6 @@ def push_dataset_to_ckan(catalog, catalog_id, owner_org, dataset_origin_identifi
     else:
         package['license_id'] = 'notspecified'
 
-    # Move themes to keywords
-    themes = dataset.get('theme')
-    if themes:
-        package['tags'] = package.get('tags') or []
-        theme_taxonomy = catalog.themes
-        for theme in themes:
-            label = next(x['label'] for x in theme_taxonomy if x['id'] == theme)
-            package['tags'].append({'name': label})
-
     try:
         pushed_package = ckan_portal.call_action(
             'package_update', data_dict=package)

Agregar opción para mover `theme` a `keyword` en `push_dataset_to_ckan`
**Contexto**

Los temas específicos (`theme`) son temas que tienen sentido dentro del contexto y dominio temático bajo el cual cada nodo original opera. Sirven para clasificar a sus datasets según categorías temáticas específicas a la problemática que aborda ese nodo, pero que tienen una granularidad demasiado alta para la generalidad de los datos de toda la Administración Pública.

El `theme` de un dataset en su nodo original, es una extensión del `keyword` de ese dataset en el nodo integrador (son etiquetas).

**Implementar**

`pydatajson` tiene que hacer un _downgrade_ de los `theme` originales hacia el rol de etiquetas (`keyword`) en el nodo integrador.

Agregar a la función `push_dataset_to_ckan` un argumento opcional `theme_to_keyword` con default `True`.

Este flag mueve (los _elimina_ de un lado y los escribe en otro) todos los elementos originales del array `theme` en la metadata original de un dataset y los agrega al `keyword` del dataset que va a ser empujado a un CKAN.

**Notas**

Esto es una operación de transformación de los metadatos originales cuyo sentido es preservar el uso exclusivo de temas transversales (evitando el uso de temas específicos) de un dataset en un contexto de portal diferente (con un público y alcance temático transversal, mientras que el nodo original tiene un público y alcance temático específico).

**Entregable**

La nueva opción en `push_dataset_to_ckan`, junto con sus tests asociados  y las modificaciones correspondientes a la documentación en los docs de RTD.
diff --git a/tests/test_ckan_utils.py b/tests/test_ckan_utils.py
index 942bd39..3884251 100644
--- a/tests/test_ckan_utils.py
+++ b/tests/test_ckan_utils.py
@@ -23,16 +23,17 @@ class DatasetConversionTestCase(unittest.TestCase):
         cls.distributions = cls.dataset['distribution']
 
     def test_replicated_plain_attributes_are_corrext(self):
-        package = map_dataset_to_package(self.dataset, self.catalog_id)
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes)
         plain_replicated_attributes = [('title', 'title'),
                                        ('notes', 'description'),
                                        ('url', 'landingPage')]
         for fst, snd in plain_replicated_attributes:
             self.assertEqual(self.dataset.get(snd), package.get(fst))
+        self.assertEqual('owner', package['owner_org'])
         self.assertEqual(self.catalog_id+'_'+self.dataset_id, package['id'])
 
     def test_dataset_nested_replicated_attributes_stay_the_same(self):
-        package = map_dataset_to_package(self.dataset, self.catalog_id)
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes)
         contact_point_nested = [('maintainer', 'fn'),
                                 ('maintainer_email', 'hasEmail')]
         for fst, snd in contact_point_nested:
@@ -43,7 +44,7 @@ class DatasetConversionTestCase(unittest.TestCase):
             self.assertEqual(self.dataset.get('publisher').get(snd), package.get(fst))
 
     def test_dataset_array_attributes_are_correct(self):
-        package = map_dataset_to_package(self.dataset, self.catalog_id)
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes)
         groups = [group['name'] for group in package.get('groups', [])]
         super_themes = [title_to_name(s_theme.lower()) for s_theme in self.dataset.get('superTheme')]
         try:
@@ -53,13 +54,38 @@ class DatasetConversionTestCase(unittest.TestCase):
 
         tags = [tag['name'] for tag in package['tags']]
         keywords = self.dataset.get('keyword', [])
+
+        themes = self.dataset.get('theme', [])
+        theme_labels = []
+        for theme in themes:
+            label = next(x['label'] for x in self.catalog.themes if x['id'] == theme)
+            theme_labels.append(label)
+
+        try:
+            self.assertItemsEqual(keywords + theme_labels, tags)
+        except AttributeError:
+            self.assertCountEqual(keywords + theme_labels, tags)
+
+    def test_themes_are_preserved_if_not_demoted(self):
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes,
+                                         demote_themes=False)
+        groups = [group['name'] for group in package.get('groups', [])]
+        super_themes = [title_to_name(s_theme.lower()) for s_theme in self.dataset.get('superTheme')]
+        themes = self.dataset.get('theme', [])
+        tags = [tag['name'] for tag in package['tags']]
+        keywords = self.dataset.get('keyword', [])
+
+        try:
+            self.assertItemsEqual(super_themes + themes, groups)
+        except AttributeError:
+            self.assertCountEqual(super_themes + themes, groups)
         try:
             self.assertItemsEqual(keywords, tags)
         except AttributeError:
             self.assertCountEqual(keywords, tags)
 
     def test_dataset_extra_attributes_are_correct(self):
-        package = map_dataset_to_package(self.dataset, self.catalog_id)
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes)
 #       extras are included in dataset
         if package['extras']:
             for extra in package['extras']:
@@ -78,7 +104,7 @@ class DatasetConversionTestCase(unittest.TestCase):
                     self.assertEqual(dataset_value, extra_value)
 
     def test_dataset_extra_attributes_are_complete(self):
-        package = map_dataset_to_package(self.dataset, self.catalog_id)
+        package = map_dataset_to_package(self.dataset, self.catalog_id, 'owner', self.catalog.themes)
 #       dataset attributes are included in extras
         extra_attrs = ['issued', 'modified', 'accrualPeriodicity', 'temporal', 'language', 'spatial']
         for key in extra_attrs:

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose coverage python-coveralls pytest
mkdir tests/temp
3.6
requirements.txt requirements_dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
argh==0.27.2
asn1crypto==1.5.1
attrs==22.2.0
Babel==2.11.0
bumpversion==0.5.3
certifi==2021.5.30
cffi==1.15.1
chardet==3.0.4
ckanapi==4.0
CommonMark==0.5.4
coverage==4.1
cryptography==2.1.4
distlib==0.3.9
docopt==0.6.2
docutils==0.18.1
et-xmlfile==1.1.0
filelock==3.4.1
flake8==2.6.0
idna==2.6
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
isodate==0.6.0
jdcal==1.4.1
Jinja2==3.0.3
jsonschema==2.6.0
MarkupSafe==2.0.1
mccabe==0.5.3
multidict==5.2.0
nose==1.3.7
openpyxl==2.4.11
packaging==21.3
pathtools==0.1.2
pkginfo==1.10.0
platformdirs==2.4.0
pluggy==0.13.1
pockets==0.9.1
py==1.11.0
pycodestyle==2.0.0
pycparser==2.21
-e git+https://github.com/datosgobar/pydatajson.git@70ed537996200a79c3d3f16d4862160731314dac#egg=pydatajson
pyflakes==1.2.3
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
python-coveralls==2.9.3
python-dateutil==2.6.1
pytz==2025.2
PyYAML==3.11
recommonmark==0.4.0
requests==2.18.4
requests-toolbelt==1.0.0
rfc3987==1.3.7
six==1.11.0
snowballstemmer==2.2.0
Sphinx==1.5.2
sphinx-rtd-theme==0.2.4
sphinxcontrib-napoleon==0.6.1
tomli==1.2.3
tox==2.9.1
tqdm==4.64.1
twine==1.9.1
typing_extensions==4.1.1
unicodecsv==0.14.1
Unidecode==0.4.21
urllib3==1.22
vcrpy==1.11.1
virtualenv==20.17.1
watchdog==0.8.3
wrapt==1.16.0
yarl==1.7.2
zipp==3.6.0

name: pydatajson
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - argh==0.27.2
      - asn1crypto==1.5.1
      - attrs==22.2.0
      - babel==2.11.0
      - bumpversion==0.5.3
      - cffi==1.15.1
      - chardet==3.0.4
      - ckanapi==4.0
      - commonmark==0.5.4
      - coverage==4.1
      - cryptography==2.1.4
      - distlib==0.3.9
      - docopt==0.6.2
      - docutils==0.18.1
      - et-xmlfile==1.1.0
      - filelock==3.4.1
      - flake8==2.6.0
      - idna==2.6
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - isodate==0.6.0
      - jdcal==1.4.1
      - jinja2==3.0.3
      - jsonschema==2.6.0
      - markupsafe==2.0.1
      - mccabe==0.5.3
      - multidict==5.2.0
      - nose==1.3.7
      - openpyxl==2.4.11
      - packaging==21.3
      - pathtools==0.1.2
      - pkginfo==1.10.0
      - platformdirs==2.4.0
      - pluggy==0.13.1
      - pockets==0.9.1
      - py==1.11.0
      - pycodestyle==2.0.0
      - pycparser==2.21
      - pyflakes==1.2.3
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-coveralls==2.9.3
      - python-dateutil==2.6.1
      - pytz==2025.2
      - pyyaml==3.11
      - recommonmark==0.4.0
      - requests==2.18.4
      - requests-toolbelt==1.0.0
      - rfc3987==1.3.7
      - six==1.11.0
      - snowballstemmer==2.2.0
      - sphinx==1.5.2
      - sphinx-rtd-theme==0.2.4
      - sphinxcontrib-napoleon==0.6.1
      - tomli==1.2.3
      - tox==2.9.1
      - tqdm==4.64.1
      - twine==1.9.1
      - typing-extensions==4.1.1
      - unicodecsv==0.14.1
      - unidecode==0.04.21
      - urllib3==1.22
      - vcrpy==1.11.1
      - virtualenv==20.17.1
      - watchdog==0.8.3
      - wrapt==1.16.0
      - yarl==1.7.2
      - zipp==3.6.0
prefix: /opt/conda/envs/pydatajson

tests/test_ckan_utils.py::DatasetConversionTestCase::test_dataset_array_attributes_are_correct tests/test_ckan_utils.py::DatasetConversionTestCase::test_dataset_extra_attributes_are_complete tests/test_ckan_utils.py::DatasetConversionTestCase::test_dataset_extra_attributes_are_correct tests/test_ckan_utils.py::DatasetConversionTestCase::test_dataset_nested_replicated_attributes_stay_the_same tests/test_ckan_utils.py::DatasetConversionTestCase::test_replicated_plain_attributes_are_corrext tests/test_ckan_utils.py::DatasetConversionTestCase::test_themes_are_preserved_if_not_demoted
tests/test_ckan_utils.py::DatasetConversionTestCase::test_resources_extra_attributes_are_created_correctly tests/test_ckan_utils.py::DatasetConversionTestCase::test_resources_replicated_attributes_stay_the_same tests/test_ckan_utils.py::DatasetConversionTestCase::test_resources_transformed_attributes_are_correct tests/test_ckan_utils.py::DatetimeConversionTests::test_dates_change_correctly tests/test_ckan_utils.py::DatetimeConversionTests::test_dates_stay_the_same tests/test_ckan_utils.py::DatetimeConversionTests::test_datetimes_without_microseconds_are_handled_correctly tests/test_ckan_utils.py::DatetimeConversionTests::test_datetimes_without_seconds_are_handled_correctly tests/test_ckan_utils.py::DatetimeConversionTests::test_datetimes_without_timezones_stay_the_same tests/test_ckan_utils.py::DatetimeConversionTests::test_timezones_are_handled_correctly
pydatajson/ckan_utils.py pydatajson/federation.py docs/MANUAL.md
pydatajson/ckan_utils.py pydatajson/federation.py docs/MANUAL.md