ckanext-csvwmapandtransform 1.0.0__py3-none-any.whl

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.
Files changed (26) hide show
  1. ckanext/csvwmapandtransform/__init__.py +0 -0
  2. ckanext/csvwmapandtransform/action.py +405 -0
  3. ckanext/csvwmapandtransform/assets/script.js +81 -0
  4. ckanext/csvwmapandtransform/assets/style.css +124 -0
  5. ckanext/csvwmapandtransform/assets/webassets.yml +13 -0
  6. ckanext/csvwmapandtransform/auth.py +23 -0
  7. ckanext/csvwmapandtransform/cli.py +18 -0
  8. ckanext/csvwmapandtransform/db.py +397 -0
  9. ckanext/csvwmapandtransform/helpers.py +67 -0
  10. ckanext/csvwmapandtransform/mapper.py +92 -0
  11. ckanext/csvwmapandtransform/plugin.py +140 -0
  12. ckanext/csvwmapandtransform/tasks.py +257 -0
  13. ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html +56 -0
  14. ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html +108 -0
  15. ckanext/csvwmapandtransform/templates/package/resource_read.html +8 -0
  16. ckanext/csvwmapandtransform/templates/package/snippets/resource_item.html +23 -0
  17. ckanext/csvwmapandtransform/tests/__init__.py +0 -0
  18. ckanext/csvwmapandtransform/views.py +205 -0
  19. ckanext_csvwmapandtransform-1.0.0-py3.13-nspkg.pth +1 -0
  20. ckanext_csvwmapandtransform-1.0.0.dist-info/METADATA +121 -0
  21. ckanext_csvwmapandtransform-1.0.0.dist-info/RECORD +26 -0
  22. ckanext_csvwmapandtransform-1.0.0.dist-info/WHEEL +5 -0
  23. ckanext_csvwmapandtransform-1.0.0.dist-info/entry_points.txt +2 -0
  24. ckanext_csvwmapandtransform-1.0.0.dist-info/licenses/LICENSE +661 -0
  25. ckanext_csvwmapandtransform-1.0.0.dist-info/namespace_packages.txt +1 -0
  26. ckanext_csvwmapandtransform-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: ckanext-csvwmapandtransform
3
+ Version: 1.0.0
4
+ Summary: Extension automatically generating csvw metadata for uploaded textual tabular data.
5
+ Home-page: https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform
6
+ Author: Thomas Hanke
7
+ Author-email: thomas.hanke@iwm.fraunhofer.de
8
+ License: AGPL
9
+ Keywords: CKAN CSVW CSV JSON-LD
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: license
24
+ Dynamic: license-file
25
+ Dynamic: summary
26
+
27
+ [![Tests](https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform/actions/workflows/test.yml/badge.svg)](https://github.com/Mat-O-Lab/ckanext-csvwmapandtransform/actions/workflows/test.yml)
28
+
29
+ # ckanext-csvwmapandtransform
30
+
31
+ Extension automatically generating csvw metadata for uploaded textual tabular data. It uploads the data of the first table documented into a datastore for the source csv file.
32
+
33
+ ## Requirements
34
+ Needs a running instance of the [MapToMethod Application](https://github.com/Mat-O-Lab/MapToMethod) and [RDFConverter Application](https://github.com/Mat-O-Lab/RDFConverter)
35
+ Point at it through env variables.
36
+ Also needed is a Api Token for an account with the right privaledges to make the background job work on private datasets and ressources.
37
+
38
+ ```bash
39
+ CSVWMAPANDTRANSFORM_TOKEN=${CKAN_API_TOKEN}
40
+ MAPTOMETHOD_CONTAINER_NAME="ckan_maptomethod"
41
+ MAPTOMETHOD_APP_PORT=5002
42
+ # must be reachable from outside container net or iframe wil not work
43
+ CKAN_MAPTOMETHOD_URL=http://<CKAN_HOST>:${MAPTOMETHOD_APP_PORT}
44
+ RDFCONVERTER_CONTAINER_NAME="ckan_rdfconverter"
45
+ RDFCONVERTER_APP_PORT=5003
46
+ CKAN_RDFCONVERTER_URL=http://${RDFCONVERTER_CONTAINER_NAME}:${RDFCONVERTER_APP_PORT}
47
+ CSVWMAPANDTRANSFORM_SQLALCHEMY_URL=postgresql://<ckandbuser>:<ckandbpassword>@<db>/ckandb
48
+ PARSER_PORT=3001
49
+ MAPPER_PORT=4000
50
+ CONVERTER_PORT=5000
51
+ ```
52
+
53
+ You can set the default formats to run trusformation on by setting the env variable CSVWMAPANDTRANSFORM_FORMATS for example
54
+ ```bash
55
+ CSVWMAPANDTRANSFORM_FORMATS="json-ld turtle n3 nt hext trig longturtle xml"
56
+ ```
57
+ else it will react to the following formats: "json json-ld turtle n3 nt hext trig longturtle xml"
58
+
59
+
60
+ CSVWMAPANDTRANSFORM_FORMATS="json json-ld turtle n3 nt hext trig longturtle xml"
61
+
62
+ Compatibility with core CKAN versions:
63
+
64
+ | CKAN version | Compatible? |
65
+ | --------------- | ------------- |
66
+ | 2.9 and arlier | not tested |
67
+ | 2.10 | yes |
68
+ | 2.11 | yes |
69
+
70
+ * "yes"
71
+ * "not tested" - I can't think of a reason why it wouldn't work
72
+ * "not yet" - there is an intention to get it working
73
+ * "no"
74
+
75
+
76
+ ## Installation
77
+
78
+ To install the extension:
79
+
80
+ 1. Activate your CKAN virtual environment, for example:
81
+ ```bash
82
+ . /usr/lib/ckan/default/bin/activate
83
+ ```
84
+ 2. Use pip to install package
85
+ ```bash
86
+ pip install ckanext-csvwmapandtransform
87
+ ```
88
+ 3. Add `csvwmapandtransform` to the `ckan.plugins` setting in your CKAN
89
+    config file (by default the config file is located at
90
+    `/etc/ckan/default/ckan.ini`).
91
+
92
+ 4. Restart CKAN. For example, if you've deployed CKAN with Apache on Ubuntu:
93
+ ```bash
94
+ sudo service apache2 reload
95
+ ```
96
+
97
+ ## Developer installation
98
+
99
+ To install ckanext-csvtocsvw for development, activate your CKAN virtualenv and
100
+ do:
101
+ ```bash
102
+ git clone https://github.com/Mat-O-Lab/ckanext-csvtocsvw.git
103
+ cd ckanext-csvtocsvw
104
+ python setup.py develop
105
+ pip install -r dev-requirements.txt
106
+ ```
107
+
108
+ ## Tests
109
+
110
+ To run the tests, do:
111
+ ```bash
112
+ pytest --ckan-ini=test.ini
113
+ ```
114
+
115
+ ## License
116
+
117
+ [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
118
+
119
+ # Acknowledgments
120
+ The authors would like to thank the Federal Government and the Heads of Government of the Länder for their funding and support within the framework of the [Platform Material Digital](https://www.materialdigital.de) consortium. Funded by the German [Federal Ministry of Education and Research (BMBF)](https://www.bmbf.de/bmbf/en/) through the [MaterialDigital](https://www.bmbf.de/SharedDocs/Publikationen/de/bmbf/5/31701_MaterialDigital.pdf?__blob=publicationFile&v=5) Call in Project [KupferDigital](https://www.materialdigital.de/project/1) - project id 13XP5119.
121
+
@@ -0,0 +1,26 @@
1
+ ckanext_csvwmapandtransform-1.0.0-py3.13-nspkg.pth,sha256=NXfLjB2L7-vMVBgj11KMWlHly-aPPPj1kuWUW7A1iMM,472
2
+ ckanext/csvwmapandtransform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ ckanext/csvwmapandtransform/action.py,sha256=9dVUJ4MBQ0hbUbRPLXBbYlcBnhqWASos-wFVFQ3Vyrg,14534
4
+ ckanext/csvwmapandtransform/auth.py,sha256=RlZkmr579ilbeV6r74kYnZo15KZdgaNs52rMa8mAN8E,767
5
+ ckanext/csvwmapandtransform/cli.py,sha256=Fts-S1FktmmvsThWdCRVETH4CTEBUgHL932sV2e2LFs,367
6
+ ckanext/csvwmapandtransform/db.py,sha256=z11lJSh1y1f31BKWWAcQ8mpaQAAhNie2rd_BhHrPTqw,11602
7
+ ckanext/csvwmapandtransform/helpers.py,sha256=zN1PYewUZITaaogh6AJYYkQd4bMg2zI89eo5tV7t1Eo,2167
8
+ ckanext/csvwmapandtransform/mapper.py,sha256=LxJRqF3LA2RdjoMctLLStdDlqqKySo6RBUmBYSwlXvU,3289
9
+ ckanext/csvwmapandtransform/plugin.py,sha256=EWlX958yL78jcKDmFVL4s5MeQ86K7YvDb09wjSD68G4,4492
10
+ ckanext/csvwmapandtransform/tasks.py,sha256=HY4f-1gftwCW_oVkxtfb9pmaq6mooTjQiuApsQXESxM,9224
11
+ ckanext/csvwmapandtransform/views.py,sha256=hR_I7HRbgyag81ZUxXOoNEb7fhGecDCgaoVrF6D4dC8,7674
12
+ ckanext/csvwmapandtransform/assets/script.js,sha256=iuPqQExUeAdedPNdgstzqwZm0-d_2IRE_wc1EzFCZzA,3306
13
+ ckanext/csvwmapandtransform/assets/style.css,sha256=ENKH6-gHFt7S6AExhyAPVlyni3fPWAALdcklSqmjbA0,1888
14
+ ckanext/csvwmapandtransform/assets/webassets.yml,sha256=OjnUVX9TGimTLdg1C4mnDHIvZmmzPVISvz3e-yHrrms,232
15
+ ckanext/csvwmapandtransform/templates/csvwmapandtransform/create_mapping.html,sha256=Pc400O-bM7GM-bcw-O-rgPOoj0dvhCKBUMY60hT343A,2269
16
+ ckanext/csvwmapandtransform/templates/csvwmapandtransform/transform.html,sha256=Cl8HnMifTdlEGKm8J8agAkTB5Hxgb_7-zoP-ednXXlU,3798
17
+ ckanext/csvwmapandtransform/templates/package/resource_read.html,sha256=b4Lj42qABgibIcVvDmU3CRTf708sQItvut8JDGAkB-8,305
18
+ ckanext/csvwmapandtransform/templates/package/snippets/resource_item.html,sha256=ke8ZUk2EtwmF2QAuGA9EGzR164qyLhS_wW4riEkLY28,697
19
+ ckanext/csvwmapandtransform/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ ckanext_csvwmapandtransform-1.0.0.dist-info/licenses/LICENSE,sha256=2lWcRAHjsQhqavGNnR30Ymxq3GJ9BaYL_dnfGO_-WFA,34500
21
+ ckanext_csvwmapandtransform-1.0.0.dist-info/METADATA,sha256=O_TELfU8BSb74Tty7YC0sUGitudUyc9-dU7VWD3xTqg,4491
22
+ ckanext_csvwmapandtransform-1.0.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
23
+ ckanext_csvwmapandtransform-1.0.0.dist-info/entry_points.txt,sha256=l03hny2ml2f5UaWSAmsSW2x9tWPwiPXiecACnawTt2Y,98
24
+ ckanext_csvwmapandtransform-1.0.0.dist-info/namespace_packages.txt,sha256=5yjNwq-s42weaiMMUuA5lZ45g99ANsfcRBCvac1JMS4,8
25
+ ckanext_csvwmapandtransform-1.0.0.dist-info/top_level.txt,sha256=5yjNwq-s42weaiMMUuA5lZ45g99ANsfcRBCvac1JMS4,8
26
+ ckanext_csvwmapandtransform-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.4.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [ckan.plugins]
2
+ csvwmapandtransform = ckanext.csvwmapandtransform.plugin:CsvwMapAndTransformPlugin