[ckan-dev] add organizations programmatically

Ian Ward ian at excess.org
Fri Dec 11 16:13:19 UTC 2015


ckanapi has a command-line interface useful for creating/updating
organizations https://github.com/ckan/ckanapi#bulk-operations

ckanapi load organizations

will accept organizations given on stdin in JSON lines format. You can
use "ckanapi dump organizations" to see the format it expects. When an
organization is loaded with a name that already exists its fields are
updated instead of created automatically.

On Fri, Dec 11, 2015 at 10:46 AM, Hildegard Gerlach
<hildegard.gerlach at jrc.ec.europa.eu> wrote:
> Dear all,
>
> I would like to add organizations programmatically reading the input from a
> JSON file.
> I have already an extension in which I read the JSON files but I am not sure
> how to proceed to create the organizations (with extra fields) and checking
> if they exist already.
> Is there something similar already around ? Or can someone tell me how I
> have to send the parameters ?
> I am using CKAN 2.2
> I tried to put some log.debug statements in the file
> ckan/ckan/logic/action/create.py and created an organization from the
> interface, but I couldn't find the log messages, i.e. the program was not
> used ?
>
> I have also seen
> http://docs.ckan.org/en/ckan-2.2/api.html#ckan.logic.action.create.organization_create
> but I am not sure how to use it.
>
> Thanks
>
> Hilde
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list