Git Product home page Git Product logo

ckanext-datajson's Introduction

ckanext-datajson

A CKAN extension to generate the /data.json file and to harvest data sources from a remote /data.json file according to the U.S. Project Open Data metadata specification (http://project-open-data.github.io/).

This plugin creates a new view at /data.json (or other configurable path) that outputs the contents of the data catalog in the Project Open Data JSON metadata format. It also creates a view at /data.jsonld which outputs the same in JSON-LD format.

The plugin also provides a harvester to import datasets from other remote /data.json files. See below for setup instructions.

And the plugin also provides a new view to validate /data.json files at http://ckanhostname/pod/validate.

This module assumes metadata is stored in CKAN in the way we do it on http://hub.healthdata.gov. If you're storing metadata under different key names, you'll have to revise ckanext/datajson/plugin.py accordingly.

Installation

To install, activate your CKAN virtualenv, install dependencies, and install the module in develop mode, which just puts the directory in your Python path.

. path/to/pyenv/bin/activate
pip install -r pip-requirements.txt
python setup.py develop

Then in your CKAN .ini file, add ``datajson'' to your ckan.plugins line:

ckan.plugins = (other plugins here...) datajson

That's the plugin for /data.json output. To make the harvester available, also add:

ckan.plugins = (other plugins here...) harvest datajson_harvest

If you're running CKAN via WSGI, we found a strange Python dependency bug. It might only affect development environments. The fix was to revise wsgi.py and add:

import ckanext

before

from paste.deploy import loadapp

Then restart your server and check out:

http://yourdomain.com/data.json
   and
http://yourdomain.com/data.jsonld
   and
http://yourdomain.com/pod/validate	

Caching The Response

If you're deploying inside Apache, some caching would be a good idea because generating the /data.json file can take a good few moments. Enable the cache modules:

a2enmod cache
a2enmod disk_cache

And then in your Apache configuration add:

CacheEnable disk /data.json
CacheRoot /tmp/apache_cache
CacheDefaultExpire 120
CacheMaxFileSize 50000000
CacheIgnoreCacheControl On
CacheIgnoreNoLastMod On
CacheStoreNoStore On

And be sure to create /tmp/apache_cache and make it writable by the Apache process.

Generating /data.json Off-Line

Generating this file is a little slow, so an alternative instead of caching is to generate the file periodically (e.g. in a cron job). In that case, you'll want to change the path that CKAN generates the file at to something other than /data.json. In your CKAN .ini file, in the app:main section, add:

ckanext.datajson.path = /internal/data.json

Now create a crontab file ("mycrontab") to download this URL to a file on disk every ten minutes:

0-59/10 * * * * wget -qO /path/to/static/data.json http://localhost/internal/data.json

And activate your crontab like so:

crontab mycrontab

In Apache, we'll want to block outside access to the "internal" URL, and also map the URL /data.json to the static file. In your httpd.conf, add:

Alias /data.json /path/to/static/data.json

<Location /internal/>
	Order deny,allow
	Allow from 127.0.0.1
	Deny from all
</Location>

And then restart Apache. Wait for the cron job to run once, then check if /data.json loads (and it should be fast!). Also double check that http://yourdomain.com/internal/data.json gives a 403 forbidden error when accessed from some other location.

Options

You can customize the URL that generates the data.json output:

ckanext.datajson.path = /data.json
ckanext.datajsonld.path = /data.jsonld
ckanext.datajsonld.id = http://www.youragency.gov/data.json

If ckanext.datajsonld.path is omitted, it defaults to replacing ".json" in your ckanext.datajson.path path with ".jsonld", so it probably won't need to be specified.

The option ckanext.datajsonld.id is the @id value used to identify the data catalog itself. If not given, it defaults to ckan.site_url.

You can also set some default values for datasets that are missing required fields. These are possible:

ckanext.datajson.default_contactpoint = Health Data Initiative
ckanext.datajson.default_mbox = [email protected]
ckanext.datajson.default_keywords = health

The Harvester

To use the data.json harvester, you'll also need to set up the CKAN harvester extension. See the CKAN harvester README at https://github.com/okfn/ckanext-harvest for how to do that. You'll set some configuration variables and then initialize the CKAN harvester plugin using:

paster --plugin=ckanext-harvest harvester initdb --config=/path/to/ckan.ini

Now you can set up a new DataJson harvester by visiting:

http://yourdomain.com/harvest

And when configuring the data source, just choose "/data.json" as the source type.

The next paragraph assumes you're using my fork of the CKAN harvest extension at https://github.com/JoshData/ckanext-harvest

In the configuration field, you can put a YAML string containing defaults for fields that may not be set in the source data.json files, e.g. enter something like this:

defaults:
  Agency: Department of Health & Human Services
  author: Substance Abuse & Mental Health Services Administration
  author_id: http://healthdata.gov/id/agency/samhsa

The keys title, notes, author, and url are stored in the corresponding CKAN package fields. tags, which must be an array of strings, is stored as CKAN package tags. All other keys are stored in package extras (i.e. the Additional Info of a package).

You may also override values found in the harvested file with fixed values set in the configuration like so:

overrides:
  author: U.S. Food and Drug Administration

You can also specify filters to control what datasets from the data.json file are imported. By default everything is imported. In a "filters" section, map data.json field names to an array of permitted values or in an "excludes" section map data.json field names to values or regular expressions surrounded in forward slashes that will cause datasets to be excluded:

filters:
	theme: ["Health"]
excludes:
	accessURL: ["http://example.org/dataset", "/^http://some-pattern/here/"]

Each dataset is compared to each filter and exclude (in this example, a theme filter and an accessURL exclude). To be imported, the dataset must match at least one value of a filter and may not match any value of an exclude. In this example, all imported datasets will have Health set as their theme and no accessURL will be either "http://example.org/dataset" or start with "http://some-pattern/here" (not that the final slash indicates the end of the regular expression).

Credit / Copying

Written by the HealthData.gov team.

As a work of the United States Government, this package is in the public domain within the United States. Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication (which can be found at http://creativecommons.org/publicdomain/zero/1.0/).

ckanext-datajson's People

Contributors

fuhuxia avatar georgethomas avatar joshdata avatar jstange avatar zr2d2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckanext-datajson's Issues

simplify json-ld

It might be worthwhile to simplify the JSON-LD a bit by using a more verbose context and referencing it from the json-ld. For example:

{
  "@context": "http://project-open-data.github.io/context.json",
  "title": "HealthData.gov Catalog Hub",
  "homepage": "http://hub.healthdata.gov",
  "dataset": [
    {
      "@id": "http://hub.healthdata.gov",
      "@type": "dcat:Catalog",   
      "title": "HealthData.gov Catalog Hub",
      "homepage": "http://hub.healthdata.gov",
      "dataset": [
        {
          "@id": "http://hub.healthdata.gov/dataset/7ab73b9c-238d-4a41-b789-679664810d02",
          "@type": "dcat:Dataset",
          "title": "Nursing Home Profile",
          "keyword": [
            "complaint",
            "enforcement",
            "inspection",
            "nursing homes"
          ],
          ...
        }
      },
    },
    ... 
  ]
}

and then you'd serve up the context at http://project-open-data.github.io/context.json:

{
  "@context": {
    "title": "http://purl.org/dc/terms/title",
    "homepage": "http://xmlns.com/foaf/0.1/homepage",
    "dataset": "http://www.w3.org/ns/dcat#dataset",
    "keyword": "http://www.w3.org/ns/dcat#keyword",
    ...
  }
}

The main advantages are:

  • the JSON-LD looks more like the current JSON, with an eye towards possibly folding them together?
  • implementers wouldn't need to repeat the context (perhaps incorrectly) in their own data.json files
  • the JSON could be used more idiomatically from Javascript: e.g. datasets.title instead of datasets['title'].

Publisher Field

I'm working on a modification to the extension to parse out data.json files by the organization they belong to in CKAN. One question I have is with the implementation of the publisher field - why does it map to author in CKAN rather than to organization? Was going to change this around but wanted to check on the rationale behind it first. Thanks!

"format" field type in validator incorrect?

I got a validation error stating "The 'format' field used to be a string but now it must be an array. (188 locations)" I'm not sure which field that's referring to, but if it's the format field, then the schema says it should accept a string containing a MIME type.

I'm guessing this has something to do with the fact that CKAN saves all of it's resources in in the distribution object, and format is a field that's supposed to travel with that object.

However for agencies not using CKAN, many of their datasets won't have distributions -- they are instead just going to have accessURLs, webServices along with a format in the first level of the hierarchy.

Either way, the format field should never be an array.

Internal Error on Validator

When trying to validate this .JSON file, I'm getting an internal error from the validator:

image

Any thoughts? This is the best POD validator, so I'm bummed I couldn't check my updates with it!

Error after recent updates

The harvester extension worked fine as of mid of July 2013. During the past month CKAN core, ckanext-harvest, and ckanext-datajson have gone through quite a few changes, and now the harvester gives errors during fetch stage.

I have tested the current datajson master branch on both current ckan 2.2 and old ckan 2.1. In each case it gives similar errors, as shown below.

File "/home/ubuntu/ckan/lib/default/src/ckanext-datajson/ckanext/datajson/harvester_base.py", line 237, in import_stage
self.package_index.index_package(pkg)
AttributeError: 'DataJsonHarvester' object has no attribute 'package_index'

File "/home/ubuntu/ckan/lib/default/src/ckanext-datajson/ckanext/datajson/parse_datajson.py", line 4, in parse_datajson_entry
package["title"] = datajson.get("title", defaults.get("Title"))
AttributeError: 'NoneType' object has no attribute 'get'

Update imports and calls

From Toby Dacre:

some feedback this is assuming you are running CKAN 2.0 although I
think it would also be valid for 1.8

from ckan.lib.base import BaseController, render, config
from webhelpers.html import literal
from pylons import c, request, response

BaseController, render, literal, c, request (unused) - can all be
accessed via the plugins toolkit eg p.toolkit.render this will reduce
the likelyhood of breakage of you extension in later versions of ckan
due to code refactoring.

config should not be imported directly from pylons use the
IConfigurable interface to get/process the config this is the CKAN
supported way for extensions to access the config.

sadly response is not currently available in the toolkit this is
likely to be added somepoint soon, 2.1 if I get the time.

import ckan.model
from ckan.logic.action.get import current_package_list_with_resources

actions should be accessed via p.toolkit.get_action() so that
they can be overriden by extensions etc.

also if the contexted is None then model will be autopopulated by the
get_action() returned function so you do not import ckan.model

packages = current_package_list_with_resources( { "model": ckan.model}, {})

packages = current_package_list_with_resources(None, {})

Installation instructions issue

I'm having issues with the installation instructions. I followed the instructions located at https://github.com/HHS/ckanext-datajson.

When I try to restart apache2 and hit the ckan server, I get the following error stack in the log file:

[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] mod_wsgi (pid=2683): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] mod_wsgi (pid=2683): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/etc/ckan/default/apache.wsgi", line 5, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] from paste.deploy import loadapp
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/init.py", line 3, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] from paste.deploy.loadwsgi import *
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 8, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] import pkg_resources
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2727, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] add_activation_listener(lambda dist: dist.activate())
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 700, in subscribe
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] callback(dist)
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2727, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] add_activation_listener(lambda dist: dist.activate())
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2230, in activate
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] map(declare_namespace, self._get_metadata('namespace_packages.txt'))
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 1827, in declare_namespace
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] _handle_ns(packageName, path_item)
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 1797, in _handle_ns
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] loader.load_module(packageName); module.path = path
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] mod = imp.load_module(fullname, self.file, self.filename, self.etc)
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckanext-datajson/ckanext/datajson/init.py", line 9, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] from plugin import DataJsonPlugin
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckanext-datajson/ckanext/datajson/plugin.py", line 1, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] import ckan.plugins as p
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/init.py", line 5, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] import toolkit as _toolkit
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/toolkit.py", line 4, in
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] import paste.deploy.converters as converters
[Mon Sep 29 07:46:19 2014] [error] [client 127.0.0.1] AttributeError: 'module' object has no attribute 'deploy'

There is a blurb in the steps that imply that there may be a python dependency issue with wsgi and instructs the user to do the following:

“If you're running CKAN via WSGI, we found a strange Python dependency bug. It might only affect development environments. The fix was to revise wsgi.py and add:

import ckanext
before
from paste.deploy import loadapp”

I couldn't find this wsgi.py that had this "...paste.deploy..." line, but I did find the apache.wsgi file that was located in /etc/default/ckan/. I added the import line but I still get the same issue. Are there steps in the installation instructions that are missing. I'm not familiar with python but it does seem like this is a dependency issue. Would you be able to point me in the right direction.

Harvest Job - Solr Issue

I was able to successfully create the datajson harvester job. However when tried to clear the job, data from solr was not cleared.

Steps to reproduce

  1. Start harvester job.
  2. While job is running, hit clear button
  3. Datasets from postgres are deleted but solr still has those datasets.

I believe datasets from solr should be deleted as well. Please let me know if I am missing something.

Versions
Ckan - 2.2
Postgres - 9.2
Solr - 4.5
ckan_datajson_harvester

Initialization Requires HTTPS access to project-open-data.cio.gov

For security reasons, I don't want software that I install to reach out to remote web sites during the installation or initialization process. In release v1.1, there is a file called ckanext/datajson/datajsonvalidator.py. This file has the following code starting at line 87:

omb_burueau_codes = set()
for row in csv.DictReader(urllib.urlopen("https://project-open-data.cio.gov/data/omb_bureau_codes.csv")):
    omb_burueau_codes.add(row["Agency Code"] + ":" + row["Bureau Code"])

Can this code be changed to use a local file, perhaps specified using an environment variable? The HTTPS fetch can be moved into the installation instructions. Letting this file be pulled from a local file system should improve testability as well.

As a side node, omb_burueau_codes seems to be misspelled.

Assign dataset to the same oranization as the harvest source

If a harvest source is assigned to an organization, the harvested datasets should be by default assigned to the same organization. I have created a fork and enabled this option in the fork.

Since I am having problem get the current master branch working with our CKAN 2.1 core, as reported in a previous issue, I created a dev branch and made the code change on a last known working commit. Will merge the code and submit a pull request once the previous issue is resolved.

Would highly appreciate it if you can exam the change and offer feedback.

PluginNotFoundException: datajson

I followed your instructions to install this extension (yes, I used my python virtualenv).

After adding the datajson plugin to my ckan.ini and running python setup.py develop, my ckan install
broke (latest stable release - v 2.4.0), and also execution of any python scripts in the virtualenv.

The apache log states:
[Mon Aug 24 09:40:07.653795 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] mod_wsgi (pid=9593): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Mon Aug 24 09:40:07.653851 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] mod_wsgi (pid=9593): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Mon Aug 24 09:40:07.653875 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] Traceback (most recent call last):
[Mon Aug 24 09:40:07.653894 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/etc/ckan/default/apache.wsgi", line 10, in
[Mon Aug 24 09:40:07.653956 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] application = loadapp('config:%s' % config_filepath)
[Mon Aug 24 09:40:07.653969 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Mon Aug 24 09:40:07.654119 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] return loadobj(APP, uri, name=name, *_kw)
[Mon Aug 24 09:40:07.654131 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Mon Aug 24 09:40:07.654147 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] return context.create()
[Mon Aug 24 09:40:07.654157 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
[Mon Aug 24 09:40:07.654170 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] return self.object_type.invoke(self)
[Mon Aug 24 09:40:07.654179 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Mon Aug 24 09:40:07.654191 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] return fix_call(context.object, context.global_conf, *_context.local_conf)
[Mon Aug 24 09:40:07.654199 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
[Mon Aug 24 09:40:07.654241 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] val = callable(_args, *_kw)
[Mon Aug 24 09:40:07.654263 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 58, in make_app
[Mon Aug 24 09:40:07.654364 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] load_environment(conf, app_conf)
[Mon Aug 24 09:40:07.654375 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
[Mon Aug 24 09:40:07.654476 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] p.load_all(config)
[Mon Aug 24 09:40:07.654487 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
[Mon Aug 24 09:40:07.654554 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] load(*plugins)
[Mon Aug 24 09:40:07.654564 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 148, in load
[Mon Aug 24 09:40:07.654578 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] service = _get_service(plugin)
[Mon Aug 24 09:40:07.654586 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 255, in _get_service
[Mon Aug 24 09:40:07.654598 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] raise PluginNotFoundException(plugin_name)
[Mon Aug 24 09:40:07.654613 2015] [:error] [pid 9593] [remote 127.0.0.1:6647] PluginNotFoundException: datajson

Executing any python script after installing this extension hangs up (more specifically after running python setup.py develop) and shows this trace after interrupting it (only in the virtualenv, otherwise python works normally):
Traceback (most recent call last):
File "setup.py", line 1, in
from setuptools import setup, find_packages
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/init.py", line 11, in
from setuptools.extension import Extension
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/extension.py", line 5, in
from setuptools.dist import _get_unpatched
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/dist.py", line 16, in
import pkg_resources
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 2736, in
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 698, in subscribe
callback(dist)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 2736, in
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 2274, in activate
list(map(declare_namespace, self._get_metadata('namespace_packages.txt')))
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 1882, in declare_namespace
_handle_ns(packageName, path_item)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 1849, in _handle_ns
loader.load_module(packageName)
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/vid/ckan-extensions/ckanext-datajson/ckanext/datajson/init.py", line 9, in
from plugin import DataJsonPlugin
File "/home/vid/ckan-extensions/ckanext-datajson/ckanext/datajson/plugin.py", line 14, in
from package_to_pod import make_datajson_entry, get_facet_fields
File "/home/vid/ckan-extensions/ckanext-datajson/ckanext/datajson/package_to_pod.py", line 3, in
import validator
File "/home/vid/ckan-extensions/ckanext-datajson/ckanext/datajson/validator.py", line 28, in
for row in csv.DictReader(urllib.urlopen("https://raw.github.com/seanherron/OMB-Agency-Bureau-and-Treasury-Codes/master/omb-agency-bureau-treasury-codes.csv")):
File "/usr/lib/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 208, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 437, in open_https
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 797, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1178, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 562, in create_connection
sock.connect(sa)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
KeyboardInterrupt

Why does python break after installing this extension? Is there a way to make it work and how?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.