A harvester to harvest LOSD data into the Statistik Stadt Zürich CKAN instance. | Read-only mirror of https://github.com/opendatazurich/ckanext-stadtzh_losdharvest — Stadt Zürich. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-12-08 15:56:08 +01:00
.github/workflows tests: Install current versions of stadtzh ckanexts 2025-11-05 13:52:54 +01:00
ckanext after_parsing komplett entfernen 2025-12-08 15:34:05 +01:00
.coveragerc Initial commit 2020-10-27 09:24:53 +01:00
.gitignore change dcterms url back to http, revert changes in gitignore 2025-01-20 10:36:06 +01:00
.isort.cfg style: Mark requests as third-party library 2022-11-30 17:50:38 +01:00
__init__.py Get all the views from the source url and then get all their data 2021-03-25 18:00:24 +01:00
dev-requirements.txt update: Update dependencies 2025-10-01 10:13:50 +02:00
LICENSE Initial commit 2020-10-27 09:24:53 +01:00
MANIFEST.in Initial commit 2020-10-27 09:24:53 +01:00
README.rst doc: add validation notes to README 2025-06-13 14:54:09 +02:00
requirements.txt update: Update dependencies 2025-10-01 10:13:50 +02:00
setup.cfg tests: Improve tests for syntax and complexity 2024-02-06 13:10:34 +01:00
setup.py style: Run black and isort 2023-08-31 10:07:16 +02:00
solr_schema.xml Fix travis build that was failing 2021-05-06 19:13:00 +02:00
test.ini tests: Update test-core.ini location to run in docker container 2024-02-08 11:33:56 +01:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. image:: https://www.repostatus.org/badges/latest/active.svg
   :alt: Project Status: Active  The project has reached a stable, usable state and is being actively developed.
   :target: https://www.repostatus.org/#active

===========================
ckanext-stadtzh_losdharvest
===========================

A harvester to import datasets from the City of Zürich's LOSD portal to its
CKAN instance (https://data.stadt-zuerich.ch/).


------------
Requirements
------------

This harvester was developed against CKAN 2.10.


------------
Installation
------------

.. Add any additional install steps to the list below.
   For example installing any non-Python dependencies or adding any required
   config settings.

To install ckanext-stadtzh_losdharvest:

1. Activate your CKAN virtual environment, for example::

     . /usr/lib/ckan/default/bin/activate

2. Install the ckanext-stadtzh_losdharvest Python package into your virtual environment::

     pip install ckanext-stadtzh_losdharvest

3. Add ``stadtzh_losdharvest`` to the ``ckan.plugins`` setting in your CKAN
   config file (by default the config file is located at
   ``/etc/ckan/default/production.ini``).

4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu::

     sudo service apache2 reload


---------------
Config Settings
---------------

Add the profile to the CKAN config as below. If you have multiple profiles,
separate them with spaces::

   ckanext.dcat.rdf.profiles = stadtzh_losdharvest_dcat


-----------------------
Harvester Configuration
-----------------------

The RDF format of the data to be harvested can be set in the harvester
configuration. If it is not set, the default value is "text/turtle"::

    {
      "rdf_format":"text/turtle"
    }


-----------------------
Data Validation
-----------------------

The Harvester imports datasets on the following conditions::

dcterms:issued
    Dataset will not be published if its issued date is in the future.

------------------------
Development Installation
------------------------

To install ckanext-stadtzh_losdharvest for development, activate your CKAN virtualenv and
do::

    git clone https://github.com/opendatazurich/ckanext-stadtzh_losdharvest.git
    cd ckanext-stadtzh_losdharvest
    python setup.py develop
    pip install -r dev-requirements.txt


-----------------
Running the Tests
-----------------

To run the tests, do::

    pytest --ckan-ini=test.ini --disable-warnings ckanext/stadtzhtheme/tests

To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (``pip install coverage``) then run::

    pytest --ckan-ini=test.ini --cov=ckanext.stadtzh_losdharvest --disable-warnings ckanext/stadtzh_losdharvest/tests