Skip to content

Instantly share code, notes, and snippets.

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/a23eabe6640b531ef21fb0d06de70fc8 to your computer and use it in GitHub Desktop.
Save MBcode/a23eabe6640b531ef21fb0d06de70fc8 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": "344a9c94",
"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": "13fb4c32",
"metadata": {
"tags": [
"injected-parameters"
]
},
"outputs": [],
"source": [
"# Parameters\n",
"url = \"http://www.earthchem.org/library/browse/view?id=1472\"\n",
"ext = \"application/vnd.ms-excel\"\n",
"urn = \"urn:gleaner:summoned:iedadata:ba30bda189c8a02c0dcc491b0e408779e48834b2\"\n",
"q = None\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "633f8b4f",
"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": "99a27fb6",
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"!ls -l "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "729f7405",
"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/http:www.earthchem.orglibrarybrowseviewid=1472.ipynb",
"parameters": {
"ext": "application/vnd.ms-excel",
"q": null,
"url": "http://www.earthchem.org/library/browse/view?id=1472",
"urn": "urn:gleaner:summoned:iedadata:ba30bda189c8a02c0dcc491b0e408779e48834b2"
},
"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