Helpers
build_gbif_nav_item(package_name, resource_id, record_id, version=None)
¶
Creates the gbif specimen nav item allowing the user to navigate to the gbif views of the specimen record data. A single nav item is returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
the package name (or id) |
required | |
resource_id
|
the resource id |
required | |
record_id
|
the record id |
required | |
version
|
the version of the record, or None if no version is present |
None
|
Returns:
| Type | Description |
|---|---|
|
a nav items |
Source code in ckanext/gbif/lib/helpers.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
dqi_get_severity(errors, gbif_id)
¶
Get status for severity of errors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
errors
|
a list of errors |
required | |
gbif_id
|
the GBIF occurrence id for this record |
required |
Returns:
| Type | Description |
|---|---|
|
the status to show |
Source code in ckanext/gbif/lib/helpers.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
dqi_parse_errors(errors)
¶
Convert each DQI status string into a more detailed dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
errors
|
a list of error names |
required |
Returns:
| Type | Description |
|---|---|
|
a list of dicts of information about each error |
Source code in ckanext/gbif/lib/helpers.py
18 19 20 21 22 23 24 25 26 27 28 29 30 | |
gbif_get_classification(gbif_record)
¶
Loop through all the classification parts, building an array of parts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gbif_record
|
return: |
required |
Source code in ckanext/gbif/lib/helpers.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
gbif_get_geography(occurrence)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
occurrence
|
|
required |
Source code in ckanext/gbif/lib/helpers.py
85 86 87 88 89 90 91 92 93 94 95 96 | |
gbif_render_datetime(date_str)
¶
Render a GBIF formatted datetime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
date_str
|
return: |
required |
Source code in ckanext/gbif/lib/helpers.py
99 100 101 102 103 104 105 | |
get_gbif_record_url(pkg, res, rec)
¶
Given details about a combination of package, resource and record, return the GBIF view URL created from them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pkg
|
the package dict |
required | |
res
|
the resource dict |
required | |
rec
|
the record dict |
required |
Returns:
| Type | Description |
|---|---|
|
the link to the GBIF view for this record/resource/package combo |
Source code in ckanext/gbif/lib/helpers.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |