Skip to content

Instantly share code, notes, and snippets.

@MBcode
Created November 15, 2022 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MBcode/89444027fc0136a63fa0dfebd3932911 to your computer and use it in GitHub Desktop.
Save MBcode/89444027fc0136a63fa0dfebd3932911 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "9701b096",
"metadata": {
"papermill": {},
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"#github.com/nteract/papermill'parameters'tag used to inject them into template then post a gist runable by colab\n",
"url,ext,urn=None,None,None\n",
"%load_ext rpy2.ipython\n",
"%load_ext google.colab.data_table\n",
"import httpimport\n",
"with httpimport.github_repo('earthcube', 'earthcube_utilities'):\n",
" import earthcube_utilities as ec\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6eac8014",
"metadata": {
"tags": [
"injected-parameters"
]
},
"outputs": [],
"source": [
"# Parameters\n",
"url = \"https://www.usap-dc.org/view/dataset/601599\"\n",
"ext = \"\"\n",
"urn = \"urn:gleaner:summoned:iedadata:b24c3c991947a674178e8d25bb5df70ce1936d09\"\n",
"q = None\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "644d123a",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"ec.wget_rdf(urn)\n",
"#!ls -l or FilePaneBrowser on left, to see it\n",
"df=ec.read_file(url,ext)\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "ed5df032",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"!ls -l "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "11240599",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"ec.viz() #shows .nt metadata from urn, can use for (rdf)xml as well "
]
}
],
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
},
"papermill": {
"default_parameters": {},
"environment_variables": {},
"input_path": "/app/templates/template.ipynb",
"output_path": "/tmp/https:www.usap-dc.orgviewdataset601599.ipynb",
"parameters": {
"ext": "",
"q": null,
"url": "https://www.usap-dc.org/view/dataset/601599",
"urn": "urn:gleaner:summoned:iedadata:b24c3c991947a674178e8d25bb5df70ce1936d09"
},
"version": "2.4.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment