Overview • Requirements • Improvements • Installation • Tests • Release • License
ckanext-miteco extension is a tool designed to extend and customise the CKAN metadata and Open Data catalogue for the Spanish Ministry for Ecological Transition and Demographic Challenge (MITECO). This extension provides specific and thematic functionalities that allow a better management, visualisation and analysis of data related to the ecological transition and the demographic challenge.
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|---|---|
| 2.8 | ❔ Not tested |
| 2.9 | ✅ Yes |
| 2.10 | ✅ Yes |
ckanext-miteco needs the following extensions:
-
pip install -e git+https://github.com/mjanez/[email protected]#egg=ckanext-dcat pip install -r ./src/ckanext-dcat/requirements.txt
-
pip install -e git+https://github.com/ckan/[email protected]#egg=ckanext-scheming pip install -r ./src/ckanext-schemingdcat/requirements.txt
-
pip install -e git+https://github.com/ckan/[email protected]#egg=ckanext-spatial pip install -r ./src/ckanext-spatial/requirements.txt
-
pip install -e git+https://github.com/mjanez/[email protected]#egg=ckanext-fluent pip install -r ./src/ckanext-fluent/requirements.txt
-
pip install -e git+https://github.com/mjanez/[email protected]#egg=ckanext_schemingdcat pip install -r ./src/ckanext-schemingdcat/requirements.txt
And modify ckan.ini, You can use the default values:
ckan.plugins = "... spatial_metadata spatial_query resource_proxy geo_view geojson_view wmts_view shp_view dcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations miteco schemingdcat"ckanext-miteco tries to merge ckan and MITECO styles, it might be a good idea to store the values used in CSS directives were stored in CSS variables, so that ckanext-miteco could call them to override CKAN could call them to override CKAN styles, and changes made by the design team without having to rewrite them in the extension.
- ...
- ...
- ...
To install ckanext-miteco:
-
Activate your CKAN virtual environment, e.g.
. /usr/lib/ckan/default/bin/activate -
Clone the source and install it on the
virtualenvgit clone https://github.com/OpenDataGIS/ckanext-miteco.git cd ckanext-miteco pip install -e . pip install -r requirements.txt -
Add
mitecoto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Add
mitecospecific configuration to the CKAN config file -
Restart CKAN.
At CKAN config .ini file (in /etc/ckan/default dir), into the [app:main]
section, add:
ckan.site_logo=/images/default/logo_miteco.jpg
ckan.site_title="MITECO SIG CKAN - Des"
ckan.site_description="MITECO SIG CKAN - Des"
ckan.site_intro_text="[#en#] [](https://miteco.gob.es/) \
[](https://github.com/mjanez/ckan-docker) \
The open data portal of the [**Ministry for the Ecological Transition and the Demographic Challenge**](https://www.miteco.gob.es/) consists of an application using CKAN technology for the distribution of maps, data and spatial metadata and a \
[**CSW Catalog**]({{ {{ pycsw_url }} }}) (OGC standard) for the metadata publication and discovery about spatial resources on the web. \
[#es#] [](https://miteco.gob.es/) \
[](https://github.com/mjanez/ckan-docker) \
El portal de datos abiertos del [**Ministerio para la Transición Ecológica y el Reto Demográfico**](https://www.miteco.gob.es/) es una aplicación que utiliza la tecnología CKAN para la distribución de mapas, datos y metadatos espaciales y un \
[**Catálogo CSW**]({{ {{ pycsw_url }} }}) (estándar OGC) para la publicación y descubrimiento de metadatos sobre recursos espaciales en la web."
ckan.site_about="[#en#] [](https://miteco.gob.es/) \
[](https://github.com/mjanez/ckan-docker) \
The open data portal of the [**Ministry for the Ecological Transition and the Demographic Challenge**](https://www.miteco.gob.es/) consists of an application using CKAN technology for the distribution of maps, data and spatial metadata and a \
[**CSW Catalog**]({{ {{ pycsw_url }} }}) (OGC standard) for the metadata publication and discovery about spatial resources on the web. \
[#es#] [](https://miteco.gob.es/) \
[](https://github.com/mjanez/ckan-docker) \
El portal de datos abiertos del [**Ministerio para la Transición Ecológica y el Reto Demográfico**](https://www.miteco.gob.es/) es una aplicación que utiliza la tecnología CKAN para la distribución de mapas, datos y metadatos espaciales y un \
[**Catálogo CSW**]({{ {{ pycsw_url }} }}) (estándar OGC) para la publicación y descubrimiento de metadatos sobre recursos espaciales en la web."And in order to replace the default CKAN favicon with the desired, change the appropriate key:
ckan.favicon=/images/default/favicon.icobreadcrumbs are shown in the same order that are defined in the key's value
To install ckanext-miteco for development, activate your CKAN virtualenv and
do:
git clone https://github.com/OpenDataGIS/ckanext-miteco.git
cd ckanext-miteco
python setup.py develop
pip install -r dev-requirements.txtBe sure that ckan user has write rights in the root dir of the extension (perhaps ckanext-miteco?). If that is not the case and if for security or other reasons you can't do it, create a .pytest_cache dir at the root dir of the extension and make it writable by the ckan user.
To run the tests, at ckanext-miteco root dir do:
pip install -r dev-requirements.txt
pytest --ckan-ini=test.iniTo have a more verbose test, you can do:
pytest -vv --ckan-ini=test.ini`This will give you a few deprecation warnings. You can ignore those about code outside the extension. Ckan needs a very specific versions of the python libs it uses, so please do not mess upgrading libs in order to supress the warnings. Just ignore them.
If ckanext-miteco should be available on PyPI you can follow these steps to publish a new version:
-
Update the version number in the
setup.pyfile. See PEP 440 for how to choose version numbers. -
Make sure you have the latest version of necessary packages:
pip install --upgrade setuptools wheel twine
-
Create a source and binary distributions of the new version:
python setup.py sdist bdist_wheel && twine check dist/*
Fix any errors you get.
-
Upload the source distribution to PyPI:
twine upload dist/* -
Commit any outstanding changes:
git commit -a git push
-
Tag the new release of the project on GitHub with the version number from the
setup.pyfile. For example if the version number insetup.pyis 0.0.1 then do:git tag 0.0.1 git push --tags