API Docs

Proxies

Utilities for migrating past Invenio versions to Invenio 3.0.

class invenio_migrator.ext.InvenioMigrator(app=None)[source]

Invenio-Migrator extension.

init_app(app)[source]

Flask application initialization.

init_config(config)[source]

Initialize config.

invenio_migrator.ext.config_imp_or_default(app, config_var_imp, default)[source]

Import config var import path or use default value.

Proxies

Proxies for Invenio-Migrator.

invenio_migrator.proxies.current_migrator = <LocalProxy unbound>

Proxy to current migration context.

Records

Proxies for Invenio-Migrator.

class invenio_migrator.records.RecordDump(data, source_type='marcxml', latest_only=False, pid_fetchers=None, dojson_model=<dojson.overdo.Overdo object>)[source]

Record dump wrapper.

Wrapper around a record dump, with tools for loading the dump. Extend this class to provide custom behavior for loading of record dumps.

Known limitations:

  • Only persistent identifiers present in the last revision of the record will be registered.
is_deleted(record=None)[source]

Check if record is deleted.

missing_pids[source]

Filter persistent identifiers.

pop_first_revision()[source]

Get the first revision.

prepare_files()[source]

Get files from data dump.

prepare_pids()[source]

Prepare persistent identifiers.

prepare_revisions()[source]

Prepare data.

recid[source]

Get recid.

record[source]

Get the first revision.

class invenio_migrator.records.RecordDumpLoader[source]

Migrate a record.

classmethod create(dump)[source]

Create record based on dump.

classmethod create_file(bucket, key, file_versions)[source]

Create a single file with all versions.

classmethod create_files(record, files, existing_files)[source]

Create files.

This method is currently limited to a single bucket per record.

static create_pids(record_uuid, pids)[source]

Create persistent identifiers.

classmethod create_record(dump)[source]

Create a new record from dump.

static delete_buckets(record)[source]

Delete the bucket.

classmethod delete_record(record)[source]

Delete a record and it’s persistent identifiers.

static update_record(dump, record=None)[source]

Update an existing record.