Skip to content

Ext

gbif(config) ΒΆ

Requests a new download of our specimen dataset from GBIF, downloads this DwC-A, and queues any changes found in it, then ingests and indexes any changes that cascade from these GBIF records to their associated specimen records.

Source code in dataimporter/cli/ext.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@ext_group.command()
@with_config()
def gbif(config: Config):
    """
    Requests a new download of our specimen dataset from GBIF, downloads this DwC-A, and
    queues any changes found in it, then ingests and indexes any changes that cascade
    from these GBIF records to their associated specimen records.
    """
    if not config.gbif_username or not config.gbif_password:
        console.log('[red]gbif_username and gbif_password must be set')

    with use_importer(config) as importer:
        console.log('Queuing new GBIF changes')
        importer.queue_gbif_changes()
        console.log('Updating specimen data in MongoDB')
        importer.add_to_mongo('specimen')
        console.log('Syncing specimen changes to Elasticsearch')
        importer.sync_to_elasticsearch('specimen')
        console.log('Done')