ckanext-csvwmapandtransform 1.0.2__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ckanext_csvwmapandtransform-1.1.0/.github/workflows/pypi.yml +105 -0
- ckanext_csvwmapandtransform-1.1.0/.github/workflows/test.yml +78 -0
- ckanext_csvwmapandtransform-1.1.0/.gitignore +157 -0
- {ckanext_csvwmapandtransform-1.0.2/ckanext_csvwmapandtransform.egg-info → ckanext_csvwmapandtransform-1.1.0}/PKG-INFO +9 -14
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/__init__.py +22 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/action.py +27 -50
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/assets/script.js +1 -1
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/i18n/ckanext-csvwmapandtransform.pot +108 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/i18n/de/LC_MESSAGES/ckanext-csvwmapandtransform.po +113 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/mapper.py +143 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/plugin.py +3 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/public/.gitignore +0 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/public/dotted.png +0 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/tasks.py +354 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/templates/.gitignore +0 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/tests/__init__.py +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/views.py +1 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0/ckanext_csvwmapandtransform.egg-info}/PKG-INFO +9 -14
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/SOURCES.txt +15 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/requires.txt +2 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext_csvwmapandtransform.egg-info/scm_file_list.json +43 -0
- ckanext_csvwmapandtransform-1.1.0/ckanext_csvwmapandtransform.egg-info/scm_version.json +8 -0
- ckanext_csvwmapandtransform-1.1.0/dev-requirements.txt +1 -0
- ckanext_csvwmapandtransform-1.1.0/pyproject.toml +98 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/setup.cfg +0 -1
- ckanext_csvwmapandtransform-1.1.0/setup.py +13 -0
- ckanext_csvwmapandtransform-1.1.0/test.ini +45 -0
- ckanext_csvwmapandtransform-1.0.2/ckanext/csvwmapandtransform/mapper.py +0 -92
- ckanext_csvwmapandtransform-1.0.2/ckanext/csvwmapandtransform/tasks.py +0 -257
- ckanext_csvwmapandtransform-1.0.2/setup.py +0 -50
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/LICENSE +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/MANIFEST.in +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/README.md +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/__init__.py +0 -0
- /ckanext_csvwmapandtransform-1.0.2/ckanext/csvwmapandtransform/__init__.py → /ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/assets/.gitignore +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/assets/style.css +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/assets/webassets.yml +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/auth.py +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/cli.py +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/db.py +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/helpers.py +0 -0
- /ckanext_csvwmapandtransform-1.0.2/ckanext/csvwmapandtransform/tests/__init__.py → /ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/i18n/.gitignore +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/i18n/de/LC_MESSAGES/ckanext-csvwmapandtransform.mo +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/templates/package/resource_read.html +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext/csvwmapandtransform/templates/package/snippets/resource_item.html +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/dependency_links.txt +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/entry_points.txt +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/namespace_packages.txt +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/ckanext_csvwmapandtransform.egg-info/top_level.txt +0 -0
- {ckanext_csvwmapandtransform-1.0.2 → ckanext_csvwmapandtransform-1.1.0}/requirements.txt +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
name: upload-pypi
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release-build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Set version from release tag
|
|
18
|
+
run: echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.x"
|
|
24
|
+
|
|
25
|
+
- name: Build release distributions
|
|
26
|
+
run: |
|
|
27
|
+
# NOTE: put your own distribution build steps here.
|
|
28
|
+
python -m pip install build
|
|
29
|
+
python -m build
|
|
30
|
+
|
|
31
|
+
- name: Upload distributions
|
|
32
|
+
uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: release-dists
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
pypi-publish:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
needs:
|
|
40
|
+
- release-build
|
|
41
|
+
permissions:
|
|
42
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
43
|
+
id-token: write
|
|
44
|
+
|
|
45
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
46
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
47
|
+
environment:
|
|
48
|
+
name: pypi
|
|
49
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
50
|
+
#url: https://pypi.org/p/${GITHUB_REPOSITORY#*/}
|
|
51
|
+
#
|
|
52
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
53
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
54
|
+
url: https://pypi.org/project/${GITHUB_REPOSITORY#*/}/${{ github.event.release.name }}
|
|
55
|
+
|
|
56
|
+
steps:
|
|
57
|
+
- name: Retrieve release distributions
|
|
58
|
+
uses: actions/download-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: release-dists
|
|
61
|
+
path: dist/
|
|
62
|
+
|
|
63
|
+
- name: Publish release distributions to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
65
|
+
with:
|
|
66
|
+
packages-dir: dist/
|
|
67
|
+
sign-package:
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
needs:
|
|
70
|
+
- release-build
|
|
71
|
+
steps:
|
|
72
|
+
- name: Download all the dists
|
|
73
|
+
uses: actions/download-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: release-dists
|
|
76
|
+
path: dist/
|
|
77
|
+
- name: Sign the dists with Sigstore
|
|
78
|
+
uses: sigstore/gh-action-sigstore-python@v3.0.0
|
|
79
|
+
with:
|
|
80
|
+
inputs: >-
|
|
81
|
+
./dist/*.tar.gz
|
|
82
|
+
./dist/*.whl
|
|
83
|
+
publish-to-testpypi:
|
|
84
|
+
name: Publish Python 🐍 distribution 📦 to TestPyPI
|
|
85
|
+
needs:
|
|
86
|
+
- release-build
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
|
|
89
|
+
environment:
|
|
90
|
+
name: testpypi
|
|
91
|
+
url: https://test.pypi.org/p/${GITHUB_REPOSITORY#*/}
|
|
92
|
+
|
|
93
|
+
permissions:
|
|
94
|
+
id-token: write # IMPORTANT: mandatory for trusted publishing
|
|
95
|
+
|
|
96
|
+
steps:
|
|
97
|
+
- name: Download all the dists
|
|
98
|
+
uses: actions/download-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
name: release-dists
|
|
101
|
+
path: dist/
|
|
102
|
+
- name: Publish distribution 📦 to TestPyPI
|
|
103
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
104
|
+
with:
|
|
105
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
lint:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- uses: actions/checkout@v3
|
|
8
|
+
- uses: actions/setup-python@v4
|
|
9
|
+
with:
|
|
10
|
+
python-version: '3.11'
|
|
11
|
+
- name: Install requirements
|
|
12
|
+
run: pip install flake8 pycodestyle
|
|
13
|
+
- name: Check syntax
|
|
14
|
+
run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude ckan
|
|
15
|
+
|
|
16
|
+
test:
|
|
17
|
+
needs: lint
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
include:
|
|
21
|
+
- ckan-version: "2.11"
|
|
22
|
+
ckan-image: "ckan/ckan-dev:2.11-py3.10"
|
|
23
|
+
solr-image: "2.11-solr9-spatial"
|
|
24
|
+
harvester-version: 'master'
|
|
25
|
+
- ckan-version: "2.10"
|
|
26
|
+
ckan-image: "ckan/ckan-dev:2.10-py3.10"
|
|
27
|
+
solr-image: "2.10-solr9-spatial"
|
|
28
|
+
harvester-version: 'master'
|
|
29
|
+
fail-fast: false
|
|
30
|
+
|
|
31
|
+
name: CKAN ${{ matrix.ckan-version }}, Solr ${{ matrix.solr-image }}
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
container:
|
|
34
|
+
image: ${{ matrix.ckan-image }}
|
|
35
|
+
options: --user root
|
|
36
|
+
services:
|
|
37
|
+
solr:
|
|
38
|
+
image: ckan/ckan-solr:${{ matrix.solr-image }}
|
|
39
|
+
postgres:
|
|
40
|
+
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
|
|
41
|
+
env:
|
|
42
|
+
POSTGRES_USER: postgres
|
|
43
|
+
POSTGRES_PASSWORD: postgres
|
|
44
|
+
POSTGRES_DB: postgres
|
|
45
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
46
|
+
redis:
|
|
47
|
+
image: redis:7
|
|
48
|
+
env:
|
|
49
|
+
CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
|
|
50
|
+
CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
|
|
51
|
+
CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test
|
|
52
|
+
CKAN_SOLR_URL: http://solr:8983/solr/ckan
|
|
53
|
+
CKAN_REDIS_URL: redis://redis:6379/1
|
|
54
|
+
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v3
|
|
57
|
+
- name: Fix git safe directory
|
|
58
|
+
run: git config --global --add safe.directory '*'
|
|
59
|
+
- name: Install requirements
|
|
60
|
+
run: |
|
|
61
|
+
pip install -r requirements.txt
|
|
62
|
+
pip install -r dev-requirements.txt
|
|
63
|
+
- name: Install requirements (common)
|
|
64
|
+
run: |
|
|
65
|
+
pip install -e .
|
|
66
|
+
# Replace default path to CKAN core config file with the one on the container
|
|
67
|
+
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
|
|
68
|
+
- name: Setup extension
|
|
69
|
+
run: |
|
|
70
|
+
ckan -c test.ini db init
|
|
71
|
+
- name: Run tests
|
|
72
|
+
run: pytest --ckan-ini=test.ini --cov=ckanext.csvwmapandtransform --disable-warnings ckanext/csvwmapandtransform || ([ $? = 5 ] && exit 0 || exit $?)
|
|
73
|
+
- name: Upload coverage report to codecov
|
|
74
|
+
uses: codecov/codecov-action@v1
|
|
75
|
+
with:
|
|
76
|
+
file: ./coverage.xml
|
|
77
|
+
|
|
78
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
ckanect/csvwmapandtransform/__pycache__/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.so
|
|
9
|
+
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Django stuff:
|
|
56
|
+
*.log
|
|
57
|
+
local_settings.py
|
|
58
|
+
db.sqlite3
|
|
59
|
+
db.sqlite3-journal
|
|
60
|
+
|
|
61
|
+
# Flask stuff:
|
|
62
|
+
instance/
|
|
63
|
+
.webassets-cache
|
|
64
|
+
|
|
65
|
+
# Scrapy stuff:
|
|
66
|
+
.scrapy
|
|
67
|
+
|
|
68
|
+
# Sphinx documentation
|
|
69
|
+
docs/_build/
|
|
70
|
+
|
|
71
|
+
# PyBuilder
|
|
72
|
+
.pybuilder/
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
84
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
85
|
+
# .python-version
|
|
86
|
+
|
|
87
|
+
# pipenv
|
|
88
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
89
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
90
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
91
|
+
# install all needed dependencies.
|
|
92
|
+
#Pipfile.lock
|
|
93
|
+
|
|
94
|
+
# poetry
|
|
95
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
96
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
97
|
+
# commonly ignored for libraries.
|
|
98
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
99
|
+
#poetry.lock
|
|
100
|
+
|
|
101
|
+
# pdm
|
|
102
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
103
|
+
#pdm.lock
|
|
104
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
105
|
+
# in version control.
|
|
106
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
107
|
+
.pdm.toml
|
|
108
|
+
|
|
109
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
110
|
+
__pypackages__/
|
|
111
|
+
|
|
112
|
+
# Celery stuff
|
|
113
|
+
celerybeat-schedule
|
|
114
|
+
celerybeat.pid
|
|
115
|
+
|
|
116
|
+
# SageMath parsed files
|
|
117
|
+
*.sage.py
|
|
118
|
+
|
|
119
|
+
# Environments
|
|
120
|
+
.env
|
|
121
|
+
.venv
|
|
122
|
+
env/
|
|
123
|
+
venv/
|
|
124
|
+
ENV/
|
|
125
|
+
env.bak/
|
|
126
|
+
venv.bak/
|
|
127
|
+
|
|
128
|
+
# Spyder project settings
|
|
129
|
+
.spyderproject
|
|
130
|
+
.spyproject
|
|
131
|
+
|
|
132
|
+
# Rope project settings
|
|
133
|
+
.ropeproject
|
|
134
|
+
|
|
135
|
+
# mkdocs documentation
|
|
136
|
+
/site
|
|
137
|
+
|
|
138
|
+
# mypy
|
|
139
|
+
.mypy_cache/
|
|
140
|
+
.dmypy.json
|
|
141
|
+
dmypy.json
|
|
142
|
+
|
|
143
|
+
# Pyre type checker
|
|
144
|
+
.pyre/
|
|
145
|
+
|
|
146
|
+
# pytype static type analyzer
|
|
147
|
+
.pytype/
|
|
148
|
+
|
|
149
|
+
# Cython debug symbols
|
|
150
|
+
cython_debug/
|
|
151
|
+
|
|
152
|
+
# PyCharm
|
|
153
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
154
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
155
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
156
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
157
|
+
#.idea/
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ckanext-csvwmapandtransform
|
|
3
|
-
Version: 1.0
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: CKAN extension facilitating YARRRML mappings in conjunction with RDFConverter to run automatic transforms matching best fitting maps as a background job.
|
|
5
5
|
Home-page: https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform
|
|
6
6
|
Author: Thomas Hanke
|
|
7
|
-
Author-email: thomas.hanke@iwm.fraunhofer.de
|
|
7
|
+
Author-email: Thomas Hanke <thomas.hanke@iwm.fraunhofer.de>
|
|
8
8
|
License: AGPL
|
|
9
|
-
|
|
9
|
+
Project-URL: Homepage, https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform
|
|
10
|
+
Keywords: CKAN,CSVW,CSV,JSON-LD
|
|
10
11
|
Classifier: Development Status :: 4 - Beta
|
|
11
12
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.7
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.8
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Requires-Python: >=3.7
|
|
16
18
|
Description-Content-Type: text/markdown
|
|
17
19
|
License-File: LICENSE
|
|
18
20
|
Requires-Dist: ckanapi
|
|
19
21
|
Requires-Dist: requests>=2.4.2
|
|
20
|
-
|
|
21
|
-
Requires-Dist: pytest
|
|
22
|
-
|
|
23
|
-
Dynamic: author-email
|
|
24
|
-
Dynamic: description
|
|
25
|
-
Dynamic: description-content-type
|
|
26
|
-
Dynamic: home-page
|
|
27
|
-
Dynamic: license
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-ckan; extra == "dev"
|
|
28
25
|
Dynamic: license-file
|
|
29
|
-
Dynamic: requires-dist
|
|
30
|
-
Dynamic: summary
|
|
31
26
|
|
|
32
27
|
[](https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform/actions/workflows/test.yml)
|
|
33
28
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
"""
|
|
3
|
+
ckanext-csvwmapandtransform
|
|
4
|
+
|
|
5
|
+
A CKAN extension to automate mapping of CSVW metadata documents to knowledge graphs
|
|
6
|
+
and run automatic pipelines.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# Expose package version from setuptools-scm
|
|
10
|
+
try:
|
|
11
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
12
|
+
except ImportError:
|
|
13
|
+
# Python < 3.8 fallback
|
|
14
|
+
from importlib_metadata import version, PackageNotFoundError
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
__version__ = version("ckanext-csvwmapandtransform")
|
|
18
|
+
except PackageNotFoundError:
|
|
19
|
+
# Package is not installed
|
|
20
|
+
__version__ = "unknown"
|
|
21
|
+
|
|
22
|
+
__all__ = ["__version__"]
|
|
@@ -10,7 +10,6 @@ else:
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
import datetime
|
|
13
|
-
import itertools
|
|
14
13
|
import json
|
|
15
14
|
import os
|
|
16
15
|
from typing import Any
|
|
@@ -37,33 +36,21 @@ def find_first_matching_id(dicts: list, key: str, value: str):
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
def csvwmapandtransform_find_mappings(context: Context, data_dict):
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
value=MAPPING_GROUP,
|
|
39
|
+
result = toolkit.get_action("package_search")(
|
|
40
|
+
{"ignore_auth": True},
|
|
41
|
+
{"fq": f"groups:{MAPPING_GROUP}", "rows": 1000, "include_private": False},
|
|
44
42
|
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
packages = [
|
|
57
|
-
toolkit.get_action("package_show")({}, {"id": package["id"]})
|
|
58
|
-
for package in packages
|
|
59
|
-
]
|
|
60
|
-
resources = list(
|
|
61
|
-
itertools.chain.from_iterable(
|
|
62
|
-
[package["resources"] for package in packages]
|
|
63
|
-
)
|
|
64
|
-
)
|
|
65
|
-
else:
|
|
66
|
-
resources = list()
|
|
43
|
+
packages = result.get("results", [])
|
|
44
|
+
if not packages:
|
|
45
|
+
log.warn("group with name mappings not found or empty!")
|
|
46
|
+
resources = [
|
|
47
|
+
r
|
|
48
|
+
for pkg in packages
|
|
49
|
+
for r in pkg.get("resources", [])
|
|
50
|
+
if r.get("format", "").upper() == "YAML"
|
|
51
|
+
]
|
|
52
|
+
if packages and not resources:
|
|
53
|
+
log.warning("Packages found in group '%s' but 0 YAML resources", MAPPING_GROUP)
|
|
67
54
|
return resources
|
|
68
55
|
|
|
69
56
|
|
|
@@ -135,7 +122,8 @@ def csvwmapandtransform_transform_status(
|
|
|
135
122
|
"key": "csvwmapandtransform",
|
|
136
123
|
},
|
|
137
124
|
)
|
|
138
|
-
except:
|
|
125
|
+
except toolkit.ObjectNotFound:
|
|
126
|
+
log.debug("No task found for resource %s", res_id)
|
|
139
127
|
status = None
|
|
140
128
|
else:
|
|
141
129
|
value = json.loads(task["value"])
|
|
@@ -160,11 +148,11 @@ def csvwmapandtransform_transform_status(
|
|
|
160
148
|
db_job = db.get_job(job_id)
|
|
161
149
|
|
|
162
150
|
if db_job and db_job.get("logs"):
|
|
163
|
-
for
|
|
164
|
-
if "timestamp" in
|
|
165
|
-
|
|
151
|
+
for entry in db_job["logs"]:
|
|
152
|
+
if "timestamp" in entry and isinstance(
|
|
153
|
+
entry["timestamp"], datetime.datetime
|
|
166
154
|
):
|
|
167
|
-
|
|
155
|
+
entry["timestamp"] = entry["timestamp"].isoformat()
|
|
168
156
|
status = dict(status, **db_job)
|
|
169
157
|
# status['task_info']=db_job
|
|
170
158
|
return status
|
|
@@ -217,25 +205,8 @@ def enqueue_transform(res_id, res_name, res_url, dataset_id, operation):
|
|
|
217
205
|
assume_task_stale_after = datetime.timedelta(seconds=3600)
|
|
218
206
|
assume_task_stillborn_after = datetime.timedelta(seconds=int(5))
|
|
219
207
|
if existing_task.get("state") == "pending":
|
|
220
|
-
# queued_res_ids = [
|
|
221
|
-
# re.search(r"'resource_id': u?'([^']+)'",
|
|
222
|
-
# job.description).groups()[0]
|
|
223
|
-
# for job in get_queue().get_jobs()
|
|
224
|
-
# if 'xloader_to_datastore' in str(job) # filter out test_job etc
|
|
225
|
-
# ]
|
|
226
208
|
updated = parse_iso_date(existing_task["last_updated"])
|
|
227
209
|
time_since_last_updated = datetime.datetime.utcnow() - updated
|
|
228
|
-
# if (res_id not in queued_res_ids
|
|
229
|
-
# and time_since_last_updated > assume_task_stillborn_after):
|
|
230
|
-
# # it's not on the queue (and if it had just been started then
|
|
231
|
-
# # its taken too long to update the task_status from pending -
|
|
232
|
-
# # the first thing it should do in the xloader job).
|
|
233
|
-
# # Let it be restarted.
|
|
234
|
-
# log.info('A pending task was found %r, but its not found in '
|
|
235
|
-
# 'the queue %r and is %s hours old',
|
|
236
|
-
# existing_task['id'], queued_res_ids,
|
|
237
|
-
# time_since_last_updated)
|
|
238
|
-
# elif time_since_last_updated > assume_task_stale_after:
|
|
239
210
|
if time_since_last_updated > assume_task_stale_after:
|
|
240
211
|
# it's been a while since the job was last updated - it's more
|
|
241
212
|
# likely something went wrong with it and the state wasn't
|
|
@@ -347,7 +318,13 @@ def csvwmapandtransform_hook(context, data_dict):
|
|
|
347
318
|
# task['task_info'] = job_info
|
|
348
319
|
resubmit = False
|
|
349
320
|
|
|
350
|
-
if status
|
|
321
|
+
if status == "error":
|
|
322
|
+
log.debug("job errored now update job db at: {}".format(task))
|
|
323
|
+
db.init()
|
|
324
|
+
job_id = json.loads(task["value"])["job_id"]
|
|
325
|
+
db.mark_job_as_errored(job_id, data_dict.get("error"))
|
|
326
|
+
|
|
327
|
+
elif status in ("complete", "running_but_viewable"):
|
|
351
328
|
# Create default views for resource if necessary (only the ones that
|
|
352
329
|
# require data to be in the DataStore)
|
|
353
330
|
resource_dict = toolkit.get_action("resource_show")(context, {"id": res_id})
|
|
@@ -52,7 +52,7 @@ ckan.module('csvwmapandtransform', function (jQuery) {
|
|
|
52
52
|
+ value.icon +
|
|
53
53
|
"'></i><div class='alert alert-"
|
|
54
54
|
+ value.alertlevel +
|
|
55
|
-
" mb-0 mt-
|
|
55
|
+
" mb-0 mt-1 py-1' role='alert'>"
|
|
56
56
|
+ value.message +
|
|
57
57
|
"</div><span class='date' title='timestamp'>"
|
|
58
58
|
+ value.timestamp +
|
ckanext_csvwmapandtransform-1.1.0/ckanext/csvwmapandtransform/i18n/ckanext-csvwmapandtransform.pot
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Translations template for ckanext-csvwmapandtransform.
|
|
2
|
+
# Copyright (C) 2025 ORGANIZATION
|
|
3
|
+
# This file is distributed under the same license as the
|
|
4
|
+
# ckanext-csvwmapandtransform project.
|
|
5
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
|
|
6
|
+
#
|
|
7
|
+
#, fuzzy
|
|
8
|
+
msgid ""
|
|
9
|
+
msgstr ""
|
|
10
|
+
"Project-Id-Version: ckanext-csvwmapandtransform 0.0.0\n"
|
|
11
|
+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
|
12
|
+
"POT-Creation-Date: 2025-05-14 07:19+0000\n"
|
|
13
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
14
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
15
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
16
|
+
"MIME-Version: 1.0\n"
|
|
17
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
19
|
+
"Generated-By: Babel 2.15.0\n"
|
|
20
|
+
|
|
21
|
+
#: ckanext/csvwmapandtransform/helpers.py:17
|
|
22
|
+
msgid "Complete"
|
|
23
|
+
msgstr ""
|
|
24
|
+
|
|
25
|
+
#: ckanext/csvwmapandtransform/helpers.py:18
|
|
26
|
+
msgid "Pending"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: ckanext/csvwmapandtransform/helpers.py:19
|
|
30
|
+
msgid "Submitting"
|
|
31
|
+
msgstr ""
|
|
32
|
+
|
|
33
|
+
#: ckanext/csvwmapandtransform/helpers.py:20
|
|
34
|
+
msgid "Error"
|
|
35
|
+
msgstr ""
|
|
36
|
+
|
|
37
|
+
#: ckanext/csvwmapandtransform/helpers.py:25
|
|
38
|
+
msgid "Not Uploaded Yet"
|
|
39
|
+
msgstr ""
|
|
40
|
+
|
|
41
|
+
#: ckanext/csvwmapandtransform/views.py:29 ckanext/csvwmapandtransform/views.py:52
|
|
42
|
+
#: ckanext/csvwmapandtransform/views.py:89 ckanext/csvwmapandtransform/views.py:163
|
|
43
|
+
msgid "Not authorized to see this page"
|
|
44
|
+
msgstr ""
|
|
45
|
+
|
|
46
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html:13
|
|
47
|
+
msgid "Map"
|
|
48
|
+
msgstr ""
|
|
49
|
+
|
|
50
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html:19
|
|
51
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:24
|
|
52
|
+
msgid "View resource"
|
|
53
|
+
msgstr ""
|
|
54
|
+
|
|
55
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html:28
|
|
56
|
+
msgid "Map resource"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:18
|
|
60
|
+
#: ckanext/csvwmapandtransform/templates/package/resource_read.html:6
|
|
61
|
+
#: ckanext/csvwmapandtransform/templates/package/snippets/resource_item.html:17
|
|
62
|
+
msgid "Transform"
|
|
63
|
+
msgstr ""
|
|
64
|
+
|
|
65
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:30
|
|
66
|
+
msgid "Edit resource"
|
|
67
|
+
msgstr ""
|
|
68
|
+
|
|
69
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:32
|
|
70
|
+
msgid "Views"
|
|
71
|
+
msgstr ""
|
|
72
|
+
|
|
73
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:36
|
|
74
|
+
msgid "Transform Status"
|
|
75
|
+
msgstr ""
|
|
76
|
+
|
|
77
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:45
|
|
78
|
+
msgid "Run Transformation"
|
|
79
|
+
msgstr ""
|
|
80
|
+
|
|
81
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:48
|
|
82
|
+
msgid "Delete"
|
|
83
|
+
msgstr ""
|
|
84
|
+
|
|
85
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:63
|
|
86
|
+
msgid "The status of the service (Green means available, Red means unavailable)"
|
|
87
|
+
msgstr ""
|
|
88
|
+
|
|
89
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:78
|
|
90
|
+
msgid "Status"
|
|
91
|
+
msgstr ""
|
|
92
|
+
|
|
93
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:82
|
|
94
|
+
msgid "Last updated"
|
|
95
|
+
msgstr ""
|
|
96
|
+
|
|
97
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:87
|
|
98
|
+
msgid "Never"
|
|
99
|
+
msgstr ""
|
|
100
|
+
|
|
101
|
+
#: ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html:92
|
|
102
|
+
msgid "Graph Update Log"
|
|
103
|
+
msgstr ""
|
|
104
|
+
|
|
105
|
+
#: ckanext/csvwmapandtransform/templates/package/snippets/resource_item.html:10
|
|
106
|
+
msgid "Create Mapping"
|
|
107
|
+
msgstr ""
|
|
108
|
+
|