This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def harvesters_info_show(context,data_dict): | |
check_access('harvesters_info_show',context,data_dict) | |
available_harvesters = [] | |
for harvester in PluginImplementations(IHarvester): | |
info = harvester.info() | |
if not info or 'name' not in info: | |
log.error('Harvester %r does not provide the harvester name in the info response' % str(harvester)) | |
continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"comment": "This is an example of using the Distribution field to identify a number of resources related to a dataset. See also http://project-open-data.github.io/schema/#expanded-fields", | |
"distribution": [ | |
{ | |
"accessURL": "https://api.data.gov/unicorns", | |
"format": "application/json" | |
}, | |
{ | |
"accessURL": "https://static.data.gov/coolfile.csv", | |
"format": "text/csv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def package_extras_save(extra_dicts, obj, context): | |
allow_partial_update = context.get("allow_partial_update", False) | |
if extra_dicts is None and allow_partial_update: | |
return | |
model = context["model"] | |
session = context["session"] | |
extras_list = obj.extras_list | |
old_extras = dict((extra.key, extra) for extra in extras_list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def augment_data(data, schema): | |
'''add missing, extras and junk data''' | |
flattented_schema = flatten_schema(schema) | |
key_combinations = get_all_key_combinations(data, flattented_schema) | |
full_schema = make_full_schema(data, schema) | |
new_data = copy.copy(data) | |
## fill junk and extras |
NewerOlder