User Guides on How to ... - wmo-im/et-acdm GitHub Wiki
A collection of "How to do" documents to help users with MetaData uploading into the OSCAR
Quick Reference on How to Manually Modify/Create and Upload XML MD into the OSCAR DB
Note: Use the OSCAR test DB - https://oscardepl.wmo.int/surface
Note: Please consult the OSCAR/Surface User Manual, specifically the Annexes for the use of the OSCAR/Surface API.
OSCAR Account Setup (One Off)
- Create OSCAR account (login details) - if not already done
“Edit and Save” Station Details
- OSCAR Login
- Use OSCAR search mechanism to retrieve station’s details and display it on the screen
- Chose “Edit” option
- Modify what you see on the screen
- Choose “Save”
“Download, Edit, Copy, Paste, Submit” of an Existing Station XML
- Use OSCAR search mechanism to retrieve a station MD details
- Choose “Download” the XML
- “Edit/Modify” the XML
- OSCAR Login->”Management”->”XML Submission”
- “Copy and Paste” modified XML into the Dialog Box
- Click “Submit XML”
Manual XML Metadata Upload
- “Create” XML MD
- OSCAR Login->”Management”->”XML Submission”
- In the Dialog Box “Copy and Paste” your XML MD
- Click “Submit XML”
Quick Reference on How to use Open Source Software to Upload WIGOS Compliant XML MD into the OSCAR DB
pyoscar (https://github.com/wmo-cop/pyoscar) Acknowledgment and Credit to: Tom Kralidis
Note: Use the OSCAR test DB - https://oscardepl.wmo.int/surface
One Off General Setup:
- Download and Install Anaconda
- Start Anaconda Navigator
- Choose CMD PROMPT
pip install pyoscar
- Create an OSCAR Account (Login Details) - if not already done
- Create and Save Token (OSCAR Login->”Management”->”Manage Machine Access”->”Generate Token”) - If not already done
XML MetaData Upload Using Single Command from CMD PROMT Line:
- Start Anaconda Navigator
- From Navigator Choose CMD PROMPT
pyoscar upload -x /your/path/to/wmdr.xml -at YOUR_API_TOKEN
NB 1: By default, the OSCAR database used is test database (depl
)
NB 2: For more info go to README.md
XML Metadata Upload Using API (python script):
- Start Anaconda Navigator
- From Navigator Choose Spyder
In your script:
from pyoscar import OSCARClient
# (note: default OSCAR environment is `depl`)
client = OSCARClient(api_token='your token’)
# Running script in a directory where your xml file(s) are:
for filenm in os.listdir(os.getcwd()):
if filenm.endswith(".xml"):
with open(filenm) as fh:
data = fh.read()
response = client.upload(data)
Quick Reference on How to Use Open Source Software to Convert YAML Format Metadata to WIGOS Compliant XML Metadata Format
pygeometa (https://github.com/geopython/pygeometa) Acknowledgment and Credit to: Tom Kralidis
One Off General Setup
- Download and Install Anaconda
- Start Anaconda Navigator
- Choose CMD PROMPT
pip install pygeometa
YAML to XML Metadata Conversion Using Single Command
- Start Anaconda Navigator
- From Navigator Choose CMD PROMPT
pygeometa generate-metadata --mcf=/your/path/to/file.yml --schema_local=wmo-wigos --output=some_file.xml
NB 2: For more info go to README.md
YMAL to XML MetaData Conversion using API (python script)
- Start Anaconda Navigator
- From Navigator Choose Spyder
In your script in a directory where your ymal file(s) are:
from pygeometa.core import render_template
for filenm in os.listdir(os.getcwd()):
if filenm.endswith(".yml"):
xml_string = render_template('filenm', schema='wmo-wigos')
with open('output.xml', 'w') as ff:
ff.write(xml_string)
DRAFT Guide to Manually Modify/Create and Upload XML MD into the OSCAR DB
OSCAR Account (One Off) 1 Create an OSCAR account (login details) if not already done “Edit and Save” Station Details
1 Use OSCAR search mechanism to retrieve a station MD details to display it on the screen 2 Chose “Edit” option 3 Modify what you see on the screen 4 Save the result
“Download, Edit, Copy, Paste, Submit” of an Existing Station XML
1 Use OSCAR search mechanism to retrieve a station MD details
2 “Download” the XML
3 “Edit” the XML
4 Login->”Management”->”XML Submission”
5 “Copy and Paste” modified XML into the Dialog Box
6 Click “Submit XML”
Manual XML MetaData Upload 1 “Create” XML MD 2 Login->”Management”->”XML Submission” 3 In the Dialog Box “Copy and Paste” your XML MD 4 Click “Submit XML”
DRAFT Guide to use Open Source Software to Upload XML MD into the OSCAR DB
PYOSCAR (https://github.com/wmo-cop/pyoscar) Acknowledgment and Credit to: Tom Kralidis
One Off General Setup: 1 Download and Install Anaconda 2 Start Anaconda Navigator 3 Choose CMD PROMPT 4 pip install pyoscar 5 Create the OSCAR Account (Login Details) if Not Already done 6 Create and Save Token (Login->”Management”->”Mange Machine Access”->”Generate Token”) if not already done
XML MetaData Upload Using Single Command from CMD PROMT Line: 1 Start Anaconda Navigator 2 From Navigator Choose CMD PROMPT 3 pyoscar upload -x /Your/Path/to/wmdr.xml -at YOUR_API_TOKEN NB: By default, the OSCAR database used is test database (DEPL) NB: For more info go to Read.me in Github (see above)
XML MetaData Upload Using API (python script): 1 Start Anaconda Navigator 2 From Navigator Choose Spyder 3 In your script from pyoscar import OSCARClient client = OSCARClient() #client = OSCARClient(api_token='your token, env='prod') #(NB: default prod is test database set to DEPL) client = OSCARClient(api_token='your token’)
Running script in a directory where your xml file(s) are
for filenm in os.listdir(os.getcwd()): if filenm.endswith(".xml"): with open(filenm) as fh: data = fh.read() response = client.upload(data)
DRAFT “OSCAR User Registration Procedure for MetaData Handling”
To register and get an OSCAR/Surface account (login credentials) with an appropriate level of access rights, e-mail: Dr Oksana Tarasova (GAW Head): [email protected] and cc to: Dr Stoyka Netcheva: [email protected] Lucia Cappelletti: [email protected] Dr Jörg Klausen: [email protected] Providing the following information:
- Title:
- First Name:
- Middle Name:
- Surname:
- E-mail:
- Data Centre Name:
- Country of the Data Centre:
- Organisation Hosting the Data Centre:
- Signed contract with the WMO details (e.g. MoU number and date):
- Capacity: “Program Focal Point”/”Contact Point”
- “OSCAR/Surface Web Forms (GUI)” (“Edit and Save”) Access Right: Yes/No (Only Applicable for the “Program Focal Point”)
- “Machine User” (Token XML Upload): Yes/No
Note 1: More than one person can be “Program Focal Point” for a Program/Network, one single person can also be “Program Focal Point” for more than one Program/Network. A “Program Focal Point” cannot delegate his/her rights to somebody else in the application. A request to Oksana is needed.
Note 2: Nominated “Program Focal Point” and accepted by Oksana can get both the “OSCAR/Surface Web Forms (GUI)” (“Edit and Save”) and “Machine User” (Token XML Upload) access rights by indicated so on the form above. The “Copy/Paste/Submit” of an XML access right is given by default.
Note 3: Nominated “Contact Point” and accepted by Oksana can get the “Machine User” (Token XML Upload) access right by indicated so on the form above. The “Copy/Paste/Submit” of an XML access right is given by default.