-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3800c8e
commit 30521dc
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import yaml | ||
from daiquiri_client import Client | ||
|
||
DAIQUIRI_URL = 'http://localhost:8000' | ||
TOKEN = '' | ||
|
||
with open('update_metadata.yml') as f: | ||
local_schemas = yaml.safe_load(f.read()) | ||
|
||
client = Client(DAIQUIRI_URL, TOKEN) | ||
|
||
for remote_schema in client.metadata.get_schemas(nested=True): | ||
for local_schema in local_schemas: | ||
if remote_schema['name'] == local_schema['name']: | ||
client.metadata.update_schema(remote_schema['id'], local_schema) | ||
|
||
for remote_table in remote_schema['tables']: | ||
for local_table in local_schema['tables']: | ||
|
||
if remote_table['name'] == local_table['name']: | ||
client.metadata.update_table(remote_table['id'], local_table) | ||
|
||
for remote_column in remote_table['columns']: | ||
for local_column in local_table['columns']: | ||
|
||
if remote_column['name'] == local_column['name']: | ||
client.metadata.update_column(remote_column['id'], local_column) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
- name: daiquiri_data_obs | ||
title: Observational data | ||
description: Some observational data | ||
long_description: Some more information about the data. | ||
attribution: Please cite the following paper ... | ||
order: 1 | ||
license: CC0 | ||
doi: 10.1000/xyz123 | ||
published: 2020-01-01 | ||
updated: 2018-01-01 | ||
access_level: PUBLIC | ||
metadata_access_level: PUBLIC | ||
creators: | ||
- name: Anna Admin | ||
first_name: Anna | ||
last_name: Admin | ||
orcid: https://orcid.org/0000-0001-2345-6789 | ||
affiliations: "Institute of applied Administration\nInstitute of theoretical Managament" | ||
- name: Manni Manager | ||
orcid: https://orcid.org/0000-0001-2345-6790 | ||
affiliations: Institute of theoretical Managament | ||
contributors: | ||
- name: Some computer guy | ||
|
||
tables: | ||
- name: stars | ||
title: Stars | ||
description: Some stars data | ||
order: 1 | ||
license: CC0 | ||
doi: 10.1000/xyz123/123 | ||
published: 2020-01-01 | ||
updated: 2018-01-01 | ||
access_level: PUBLIC | ||
metadata_access_level: PUBLIC | ||
creators: | ||
- name: Anna Admin | ||
first_name: Anna | ||
last_name: Admin | ||
orcid: https://orcid.org/0000-0001-2345-6789 | ||
affiliations: "Institute of applied Administration\nInstitute of theoretical Managament" | ||
- name: Manni Manager | ||
orcid: https://orcid.org/0000-0001-2345-6790 | ||
affiliations: Institute of theoretical Managament | ||
|
||
columns: | ||
- name: id | ||
ucd: meta.id;meta.main | ||
- name: ra | ||
ucd: pos.eq.ra;meta.main | ||
- name: dec | ||
ucd: pos.eq.dec;meta.main | ||
- name: parallax | ||
ucd: pos.parallax |