Skip to content

Commit

Permalink
Update subscriptions example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Oct 10, 2019
1 parent 986acf6 commit ca20f13
Showing 1 changed file with 40 additions and 22 deletions.
62 changes: 40 additions & 22 deletions examples/_debug/subscriptions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"credentials = Credentials('arroyo-carto', '')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -68,12 +59,12 @@
" <Dataset('u360_cadaster_23e61803')>,\n",
" <Dataset('od_acsquantile_7bc07dac')>,\n",
" <Dataset('od_acsquantile_74829d18')>,\n",
" <Dataset('ags_sociodemogr_e128078d')>,\n",
" <Dataset('od_acs_59534db1')>,\n",
" <Dataset('od_acs_57d06d64')>,\n",
" <Dataset('od_acs_13345497')>,\n",
" <Dataset('od_acsquantile_8899ff3')>,\n",
" <Dataset('pb_pointsofint_f8c10b50')>,\n",
" <Dataset('ags_sociodemogr_e128078d')>,\n",
" <Dataset('bbva_basicstats_f9f50dc7')>,\n",
" <Dataset('bbva_categorydis_c55e1f44')>,\n",
" <Dataset('ags_crimerisk_9ec89442')>,\n",
Expand Down Expand Up @@ -574,7 +565,7 @@
" <Geography('od_stateclippe_8d79f5be')>])"
]
},
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -583,6 +574,18 @@
"Catalog().datasets, Catalog().geographies"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"credentials = Credentials(\n",
" username='team-1',\n",
" api_key='',\n",
" base_url='https://team.carto-staging.com/u/team-1/')"
]
},
{
"cell_type": "code",
"execution_count": 4,
Expand All @@ -591,12 +594,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "492f1a987f79455990f9f6e0cbcf253f",
"model_id": "6a222c0693d54b6bb9ee30da951d6d5c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HTML(value='\\n <h3>Subscription contract</h3>\\n You are about to subscribe to <b>carto-do-public-data.ac"
"HTML(value='\\n <h3>Subscription contract</h3>\\n You are about to subscribe to <b>carto-do.ags.demographi"
]
},
"metadata": {},
Expand All @@ -605,7 +608,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b12b8c70f8124ade9e2e8afb034110ba",
"model_id": "57021fd9dc2444f28807711cdfd287fe",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -618,25 +621,27 @@
}
],
"source": [
"dataset = Dataset.get('carto-do-public-data.acs.demographics_acs_usa_cbsaclipped_2015_5yrs_20132017')\n",
"dataset = Dataset.get('ags_sociodemogr_e128078d')\n",
"\n",
"dataset.subscribe(credentials)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e3d59bc5ef5d4ef3adba76f787d4904b",
"model_id": "d417e50e37b647968404ea8c92d7933c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HTML(value='\\n <h3>Subscription contract</h3>\\n You are about to subscribe to <b>carto-do.bbva.geography"
"HTML(value='\\n <h3>Subscription contract</h3>\\n You are about to subscribe to <b>carto-do.carto.geograph"
]
},
"metadata": {},
Expand All @@ -645,7 +650,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1132b7f886454d26be8a824808ee8347",
"model_id": "82ddc99c9daa464394eb1f37362b736e",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -658,7 +663,7 @@
}
],
"source": [
"geography = Geography.get('bbva_censustract_c54aba1b')\n",
"geography = Geography.get('ags_q17_4739be4f')\n",
"\n",
"geography.subscribe(credentials)"
]
Expand All @@ -667,9 +672,22 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"([<Dataset('ags_sociodemogr_e128078d')>], [<Geography('ags_q17_4739be4f')>])"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# subscriptions = Catalog().subscriptions(credentials)"
"subscriptions = Catalog().subscriptions(credentials)\n",
"\n",
"subscriptions.datasets, subscriptions.geographies"
]
}
],
Expand Down

0 comments on commit ca20f13

Please sign in to comment.