Datahub::Factory::Importer::CollectiveAccess - Import data from a CollectiveAccess instance
use Datahub::Factory; use Data::Dumper qw(Dumper); my $ca = Datahub::Factory->importer('CollectiveAccess')->new( endpoint => 'https://my.ca.org/ca', username => 'datahub', password => 'datahub' ); $ca->importer->each(sub { my $item = shift; print Dumper($item); });
Datahub::Factory::Importer::CollectiveAccess uses Catmandu to fetch a list of records from a CollectiveAccess instance. It returns an Importer.
endpoint
URL of the CA instance (e.g. http://demo.collectiveaccess.org).
username
Name of a user that can be used to query the API.
password
Password for the user.
field_list
A list of fields that the CollectiveAccess API should return. Is optional and can be left empty to return the default:
[ 'ca_objects.object_id', 'ca_objects.preferred_labels', 'ca_objects.description', 'ca_objects.subtitle', 'ca_objects.geonames', 'ca_objects.lcsh_terms', 'ca_objects.colour', 'ca_objects.contentActivity', 'ca_objects.contentConcept', 'ca_objects.contentDescription', 'ca_objects.dimensions.dimensions_width', 'ca_objects.dimensions.dimensions_height', 'ca_objects.dimensions.dimensions_depth', 'ca_objects.dimensions.circumference', 'ca_objects.dimensions.dimensions_type', 'ca_objects.materialInfo.materialInfostyle', 'ca_objects.objectProductionDate', 'ca_objects.techniqueInfo.techniqueInfodatePeriod', 'ca_objects.dateText', 'ca_objects.objectName.objectObjectName', 'ca_objects.objectWorkPid.objectWorkPidDomain', 'ca_objects.objectWorkPid.objectWorkPidID', 'ca_objects.objectRecordPid.objectRecordPidDomain', 'ca_objects.objectRecordPid.objectRecordPidID', 'ca_entities.entity_id', 'ca_entities.relationship_type_code' ]
importer
A Importer that can be used in your script.
Pieter De Praetere <pieter at packed.be >
Copyright 2017- PACKED vzw
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Datahub::Factory Catmandu
To install Datahub::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Datahub::Factory
CPAN shell
perl -MCPAN -e shell install Datahub::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.