ckan | source DMS ( data management system | Dataset library
kandi X-RAY | ckan Summary
kandi X-RAY | ckan Summary
CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render a pager page
- Create a link to the page
- Update tracking_summary
- Update the database
- Package create action
- Check if group is valid
- Replace groups of a string
- Searches for a given package type
- Returns an iterator over options matching pattern
- Update the configuration
- Upgrade legacy engine
- Returns a list of organizations for a given user
- List users
- Return the fields for a resource
- Run a search query
- Update a configuration option
- User creation
- Resource creation
- Create a package
- View package show
- Update a package
- Revise a package
- Returns a resource search
- Submit a data dictionary
- Return a dictionary representation of a package
- Create a datastore
ckan Key Features
ckan Examples and Code Snippets
source ~/ckan/bin/activate
createdb -O dgu ckan --template template_postgis
sudo -u www-data /home/co/ckan/bin/paster --plugin=ckanext-packagezip packagezip init --config=/var/ckan/ckan.ini
sudo -u www-data /home/co/ckan/bin/paster --plugin=ckanext
ckan
├── docker-entrypoint.d
│ └── setup_validation.sh
├── Dockerfile
└── Dockerfile.dev
#!/bin/bash
# Create DB tables if not there
paster --plugin=ckanext-validation validation init-db -c $CKAN_INI
FROM openknowledge/ckan-dev:2.9
R
+-------------------------+ +----------+
| | | |
| openknowledge/ckan-base +----------------> ckan | (production)
| | |
Community Discussions
Trending Discussions on ckan
QUESTION
I am new to ckan. After successfully installing ckan when I went to use some ckan plugins as an example ckan-basiccharts i am getting ValueError. After some research, I understand it's related to web-assets. In basicchart folder, I change the {%resource ....} to {%asset ..}
ckanext/basiccharts/theme/templates/basechart_view.html in .html file
but I am still getting the same error. Can anyone please explain the logic behind this error and some tricks to get rid of this error?
...ANSWER
Answered 2022-Feb-16 at 13:56For migration to webassets, you need to create an assets folder and place there .js
and .css
files of the extension. In addition, you need to create webassets.yml inside the assets folder where those .js
and .css
files should be registered. This process is described here and here.
But you can use this version of ckanext-basiccharts that is compatible with current ckan versions.
QUESTION
I'm trying to make a array of complex objects from this:
https://demo.ckan.org/api/3/action/package_show?id=sample-dataset-1
I want use this array of objects to create components using map()
- I used http://json2ts.com to make the type for the response:
ANSWER
Answered 2022-Jan-07 at 12:25In the first example you're trying to push to undefined because allDatasets
wasn't initialised with a value.
QUESTION
I'm Creating a CKAN EXTENSION base in their official documentation.
https://docs.ckan.org/en/2.9/theming/templates.html#creating-a-ckan-extension
When I'm in this step,
ckan -c /etc/ckan/default/ckan.ini create -t ckanext-example_theme
I got this error. *
(default) root@ccgeo:/usr/lib/ckan/default/src# ckan -c /etc/ckan/default/ckan.ini create -t ckanext-example_theme 2021-10-27 02:27:45,515 INFO [ckan.cli] Using configuration file /etc/ckan/default/ckan.ini 2021-10-27 02:27:45,515 INFO [ckan.config.environment] Loading static files from public 2021-10-27 02:27:45,544 INFO [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates 2021-10-27 02:27:45,762 INFO [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates Usage: ckan [OPTIONS] COMMAND [ARGS]... Error: No such command 'create'. (default) root@ccgeo:/usr/lib/ckan/default/src#
ANSWER
Answered 2021-Oct-27 at 22:18There is an error in the docs, it should be
ckan generate extension
as correct CLI command
or in your case:
ckan -c /etc/ckan/default/ckan.ini generate extension -o *location-to-put-generated-template*
QUESTION
wsgi, ckan, python2.7, jquery1.4 use
An error occurred during development of python cgi simple file upload. Ajax upload request Chrome Debugging shows the file fine. It is also included in wsgi.input in the server log environ. Take that data out and make it into a tempfile Is it not properly created to create FieldStorage? All values in FieldStorage are empty
HTMLANSWER
Answered 2021-Sep-24 at 05:34The communication methods of ckan, wsgi, and python were not known exactly. However, only CGI body data came into "environ" and "FieldStorage" was not created normally when "wsgi.input" was created using that data. The reason is that it was already in the form of file storage. However, "wsgi.input" is a cgi object and cannot be read as a read. The final solution was processed by reading the data of "webob._parseed_post_vars"
QUESTION
I'm looking at extensions for CKAN, and their entry_points entries look like this:
...ANSWER
Answered 2021-Sep-09 at 22:37Per response from Zharktas on CKAN's GitHub discussion board:
The syntax is in .ini-style: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#creating-and-parsing "If data is a string or sequence of lines, it is first split into .ini-style sections (using the split_sections() utility function) and the section names are used as group names."
Click commands implemented with IClick interface do not require entry in entry_points anymore as they are executed through the new ckan command instead of paster which required that you tell paster about them via entry_points.
You can just remove whole entry if you want to support only CKAN 2.9.
QUESTION
Is there a way to disable users (other than Sysadmins) from setting datasets/packages as Public (or delete the dataset) in CKAN (basically and Editor that can't delete or set Public)? Somewhere in the source files I can see the logic related to this? Any extensions that would require user edits be approved by data stewards of a dataset before it is actually displayed to anyone on the platform (so that we could just include checking that the edit did no include setting the data/package as Public in the moderation process)?
We want to give as much editing control to Editor-privileged users as possible while still preventing them from editing the Public/Private setting for data/packages as we want only sysadmins to have this control for certain data privacy and responsibility reasons.
From the moderation route, saw this extension, but unsure if the moderation is before it is displayed (and don't have a server to test this on atm). Unsure if there are any other packages like this as the CKAN extension searchbar seems to only hit on exact words, so seems easy to miss extension that are conceptually similar but titled very differently.
Anyone with more CKAN experience know how this could be achieved (else where approximately in the CKAN source code I could start looking into adding a new extension for this)?
...ANSWER
Answered 2021-Mar-26 at 08:53Made my own extension to do what I needed: https://github.com/reedv/ckanext-publicrestrictiondatasets
Adds restrictions to datasets so that only sysadmin users can set visibility to Public. This is in order to make CKAN's behavior match closer how it is described here (https://ckan.org/portfolio/publish-and-manage-data/).
Admins can approve datasets for publication with our bulk editing tool which let’s you search, facets and pick datasets to become public or private.
QUESTION
My company is using a CKAN instance configured with Data Store and DataPusher. When a CSV file is uploaded to CKAN, DataPusher sends it to the DataStore and creates a default Data Dictionary for the resource. The Data Dictionary is a very nice feature to display the description of data fields for the users. Here is an example:
I can update the Data Dictionary using the UI, or it can be sent as part of the Fields passed to datastore_create()
.
My problem, is that I don't control the call of datastore_create()
because this method is automatically called buy the DataPusher service.
I want to programatically set the values of the Data Dictionary, but I can't find and api call that allow me to do it. An api call that update the Fields metadata. Can I do it using the Api? Or maybe it is possible create it when I create the data resource. I'd like a code example.
...ANSWER
Answered 2021-Mar-22 at 14:19You can use the API call datastore_create on top of an existing table. This will not impact the data in the table.
You should use the datastore_search to check the format of how the dictionary is saved in one of your resources (result->fields->info). Use that as your base, make the desired changes, and use it in the body of the datastore_create
call.
Unfortunately, the API call datastore_info
does not give you back that information.
The majority of the CKAN UI functionalities can be made through the API as well. In this case, you can make use of the "datastore_create" by the controller --> See Code here.
QUESTION
Basically, I want to totally disable API access for all user other than sysadmins (v2.9.1).
- Where in the code can I see the logic related to this? Closest I could find was via
ANSWER
Answered 2021-Mar-19 at 01:17Currently just hiding the API token generation tab from non sysadmin users in the web UI html (https://github.com/ckan/ckan/blob/cc000d3acf7401957d8321be53e8cabc2d9ebf3a/ckan/templates/user/api_tokens.html) by a similar mechanism that html templates can control visibility of the Visibility functionality of packages here (https://github.com/ckan/ckan/blob/master/ckan/templates/package/snippets/package_basic_fields.html#L72)...
QUESTION
I'm having problem with loading from local storage.
Here's a part of the code
...ANSWER
Answered 2021-Feb-24 at 10:37Alright, as @Yoshi stated, it was insequential promise error. I managed to fix it by using reduce().
Here are the threads that helped me
QUESTION
I want to load the data from a JSON file into R to make a new dataframe. However the JSON file consists out of other links with data, so i can't seem to find the actual data from the JSON file. I got the JSON file from this website: https://ckan.dataplatform.nl/dataset/467dc230-20e0-4c3a-8240-dccbfc20807a/resource/531cc276-b88e-49bb-a97f-443707936a12/download/p-route-autoparkeren.json
This is the code i used.
...ANSWER
Answered 2020-Dec-08 at 15:31Maybe try fromJSON
from package jsonlite
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ckan
You can use ckan like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page