The server
submodule
This module provides functions to interact with the metadata server web application.
- send new dataset metadata to the server
- update the resources on the server to match the local versions.
post_metadata(metadata, zenodo, resources=None)
Post the dataset metadata and zenodo metadata to the metadata server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata |
dict
|
The dataset metadata dictionary for a dataset |
required |
zenodo |
dict
|
The dataset metadata dictionary for a deposit |
required |
resources |
Resources | None
|
The safedata_validator resource configuration to be used. If none is provided, the standard locations are checked. |
None
|
Returns:
Type | Description |
---|---|
ZenodoFunctionResponseType
|
See here. |
Source code in safedata_validator/server.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
update_resources(resources)
Update the resources on the metadata server.
The metadata server provides the gazetteer, location aliases and any project IDs as part of the safedata R package workflow. The web server also uses those resources internally to provide information. This function is used to post the current resources to an API on the server that is used to refresh those reseources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resources |
Resources
|
The safedata_validator resource configuration to be used. If none is provided, the standard locations are checked. |
required |
Returns:
Type | Description |
---|---|
ZenodoFunctionResponseType
|
See here. |
Source code in safedata_validator/server.py
54 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 83 84 85 86 87 88 89 90 91 92 93 |
|