# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.9.1 64-bit (''sonormal'': venv)'
#     metadata:
#       interpreter:
#         hash: d76c18acb58e066edb431820c9a24f6b6ffee5ac0898d450f72c7b3ea9f67711
#     name: python3
# ---

# + tags=["outputPrepend"]
import logging
import json
import sonormal.getjsonld
import sonormal.normalize

sonormal.installDocumentLoader()

disable_logs = [
    'urllib3',
    'websockets',
    'pyppeteer'
]

logging.basicConfig(level=logging.DEBUG)
for log_name, log_obj in logging.Logger.manager.loggerDict.items():
    for test in disable_logs:
        if log_name.startswith(test):
            log_obj.disabled = True

#url = "https://datadavev.github.io/examples/jsonld/ex01.html"
url = "https://earthref.org/MagIC/17099"

response = await sonormal.getjsonld.downloadJsonAsync(url)

normalized = sonormal.normalize.normalizeJsonld(response["document"])

print(json.dumps(normalized, indent=2))

#clipboard.copy(json.dumps(normalized, indent=2))

# + pycharm={"name": "#%%\n"} tags=["outputPrepend"]
#sonormal.FORCE_SO_VERSION = False

framed = sonormal.normalize.frameSODataset(normalized)

print(json.dumps(framed, indent=2))
# -



StarcoderdataJupyterScriptsDedupFiltered