Skip to content

Commit

Permalink
started work on downloading files from private google drive in python
Browse files Browse the repository at this point in the history
  • Loading branch information
weste committed Feb 5, 2024
1 parent 9e1bdd5 commit e9c8e78
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
25 changes: 14 additions & 11 deletions data_scripts/dwellings/dwellings_denver.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# packages
import pandas as pd
import gdown

# get and clean data
url = "https://www.denvergov.org/media/gis/DataCatalog/real_property_sales_book_2013/csv/SalesBook_2013.csv"
dat = (pd.read_csv(url)
.query('~COMMUSE.notna()')
.drop(
columns = ['Model', 'Cluster', 'Group',
'CondoComplex', 'CondoComplexName', 'COMMUSE'])
.assign(
NBHD = lambda x: x.NBHD.astype('object'))
.query('LIVEAREA > 0')
.set_index('PARCEL')
)
url = "https://drive.google.com/file/d/uc?id=1Ac5zPy_8UZnI8gxxsnBs-45D_ZOUZ1PQ/"
dat = gdown.download(url)

# dat = (pd.read_csv(url)
# .query('~COMMUSE.notna()')
# .drop(
# columns = ['Model', 'Cluster', 'Group',
# 'CondoComplex', 'CondoComplexName', 'COMMUSE'])
# .assign(
# NBHD = lambda x: x.NBHD.astype('object'))
# .query('LIVEAREA > 0')
# .set_index('PARCEL')
# )


# rename columns to lower case
Expand Down
17 changes: 17 additions & 0 deletions qg6l9lqdtmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html><style nonce="uu7FxOfEuB18gJv0p21Pug">body{height:100%;margin:0;width:100%}@media (max-height:350px){.button{font-size:10px}.button-container{margin-top:16px}.button.primary-button,.button.primary-button:active,.button.primary-button:focus,.button.primary-button:hover{padding:4px 12px}.title-text{font-size:22px;line-height:24px}.subtitle-text{font-size:12px;line-height:18px}}@media (min-height:350px){.button{font-size:14px}.button-container{margin-top:16px}.button.primary-button,.button.primary-button:active,.button.primary-button:focus,.button.primary-button:hover{padding:12px 24px}.title-text{font-size:28px;line-height:36px}.subtitle-text{font-size:16px;line-height:24px}}.document-root{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;inset:0;position:absolute}.error,.login,.request-storage-access{display:none}.error,.login,.request-storage-access,.too-many-login-redirects{margin:auto;padding:36px}.document-root.show-error .error,.document-root.show-login-page .login,.document-root.show-storage-access .request-storage-access,.too-many-login-redirects{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.button-container{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.button{border:none;cursor:pointer;color:#0b57d0;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-family:Google Sans Text,Roboto,sans-serif;border-radius:100px;padding:12px;margin:0 8px;text-decoration:none}.button:hover{background-color:rgba(11,87,208,.078)}.button:active,.button:focus{background-color:rgba(11,87,208,.122)}.button.primary-button,.button.primary-button:active,.button.primary-button:focus,.button.primary-button:hover{background-color:#0b57d0;color:#fff}.button.primary-button:hover{box-shadow:0 1px 3px 1px rgba(0,0,0,.149),0 1px 2px 0 rgba(0,0,0,.302)}.icon{height:48px;margin-bottom:16px}.title-text{font-family:Google Sans,Roboto,sans-serif;text-align:center}.subtitle-text{font-family:Google Sans Text,Roboto,sans-serif;margin-top:16px;text-align:center}
/*# sourceMappingURL=style.css.map */</style><script nonce="IiIWVacIVZ7UsgIy0zQO2w">'use strict';var e=["storage_access_granted","not_in_iframe","login_counter"];function f(a,b,c){c=void 0===c?"true":c;a=new URL(a);for(var d=0;d<e.length;d++)a.searchParams.delete(e[d]);a.searchParams.set(b,c);return a.toString()};/*

Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
/*

SPDX-License-Identifier: Apache-2.0
*/
function h(){var a=new l,b=document.getElementsByClassName("document-root")[0],c=this;this.g=new m;this.h=a;this.i=b;b.getElementsByClassName("accept-button")[0].addEventListener("click",function(){return void n(c)});b.getElementsByClassName("sign-in-button")[0].addEventListener("click",function(d){return void p(c,d)})}
function q(){var a=new h;r()?t()||"function"!==typeof document.hasStorageAccess||"function"!==typeof document.requestStorageAccess?u(a,"show-login-page"):a.h.hasStorageAccess().then(function(b){b?u(a,"show-login-page"):v().then(function(c){"prompt"===c?u(a,"show-storage-access"):"granted"===c?n(a):u(a,"show-error")})},function(){u(a,"show-error")}):w(a,window.location.href,"not_in_iframe")}
function w(a,b,c){c=c?f(b,c):b;if(a.g.get()){if(b=a.g.get())c=x(c),c=z(c),void 0!==c&&(b.action=c);a.g.submit()}else window.location.href===c?window.location.reload():(a=window.location,b=x(c)||A,b=z(b),void 0!==b&&(a.href=b))}function u(a,b){a.i.className="document-root "+b}function n(a){a.h.requestStorageAccess().then(function(){w(a,window.location.href,"storage_access_granted")},function(){u(a,"show-error")})}
function p(a,b){var c;if(b=null==(c=b.currentTarget)?void 0:c.getAttribute("data-popup-url"))var d=B(window,x(b)||A),G=setInterval(function(){if(!d||d.closed){clearInterval(G);var k=window.location.href;var g=(new URL(k)).searchParams,y=1;g.has("login_counter")&&(g=Number(g.get("login_counter")),isFinite(g)&&(y=g+1));k=f(k,"login_counter",String(y));w(a,k)}},1E3)};function C(a){this.g=a}C.prototype.toString=function(){return this.g.toString()};var D={},A=new C("about:invalid#zClosurez",D);function E(a){this.j=a}function F(a){return new E(function(b){return b.substr(0,a.length+1).toLowerCase()===a+":"})}var H=[F("data"),F("http"),F("https"),F("mailto"),F("ftp"),new E(function(a){return/^[^:]*([/?#]|$)/.test(a)})];function x(a){var b=void 0===b?H:b;if(a instanceof C)return a;for(var c=0;c<b.length;++c){var d=b[c];if(d instanceof E&&d.j(a))return new C(a,D)}}var I="function"===typeof URL;
function z(a){if(a instanceof C)a=a instanceof C&&a.constructor===C?a.g:"type_error:SafeUrl";else{b:if(I){try{var b=new URL(a)}catch(c){b="https:";break b}b=b.protocol}else c:{b=document.createElement("a");try{b.href=a}catch(c){b=void 0;break c}b=b.protocol;b=":"===b||""===b?"https:":b}a="javascript:"!==b?a:void 0}return a};function B(a,b){b=z(b);return void 0!==b?a.open(b,"popupWindow","popup=yes,height=500,width=690"):null};function m(){}m.prototype.get=function(){return document.querySelector("form")};m.prototype.submit=function(){var a;null==(a=this.get())||a.submit()};function r(){var a=!0;try{a=window.self!==window.top}catch(b){}return a};function l(){}l.prototype.hasStorageAccess=function(){return document.hasStorageAccess()};function v(){return navigator.permissions.query({name:"storage-access"}).then(function(a){return a.state}).catch(function(){return"prompt"})}l.prototype.requestStorageAccess=function(){return document.requestStorageAccess()};
function t(){if(window.navigator.userAgentData&&window.navigator.userAgentData.brands)for(var a=window.navigator.userAgentData.brands,b=0;b<a.length;b++){var c=a[b];if("Google Chrome"===c.brand)return"115"===c.version||"116"===c.version}return!1};"complete"===document.readyState?q():document.addEventListener("DOMContentLoaded",J);function J(){q()};
</script><div class="document-root loading"><div class="request-storage-access"><div><img src=&#47;&#47;ssl.gstatic.com&#47;docs&#47;common&#47;product&#47;google_app_icon1.png alt=Google class="icon"></div><div class="title-text">Allow Google access to your necessary cookies</div><div class="subtitle-text">You won&#39;t be able to access this content if necessary cookies are turned off</div><div class="button-container"><a target="cookieAccessHelp" href="https://support.google.com/drive?p=enable_storage_access" class=" button">Learn more</a><button type="button" class="accept-button button primary-button">Allow cookies</button></div></div><div class="login"><div><img src=https:&#47;&#47;www.gstatic.com&#47;images&#47;branding&#47;googleg&#47;1x&#47;googleg_standard_color_48dp.png alt=Google&#32;logo class="icon"></div><div class="title-text">Sign in to your Google Account</div><div class="subtitle-text">You must sign in to access this content</div><div class="button-container"><button type="button" class="sign-in-button button primary-button" data-popup-url=https:&#47;&#47;accounts.google.com&#47;ServiceLogin?continue&#61;https:&#47;&#47;docs.google.com&#47;picker&#47;lc&amp;btmpl&#61;popup&amp;hl&#61;en>Sign in</button></div></div><div class="error"><div><img src=https:&#47;&#47;www.gstatic.com&#47;images&#47;branding&#47;googleg&#47;1x&#47;googleg_standard_color_48dp.png alt=Google&#32;logo class="icon"></div><div class="title-text">Can&#39;t access your Google Account</div><div class="subtitle-text">We can&#39;t access this content right now. Try signing into your Google account or allowing cookie access to proceed.</div><div class="button-container"><a target="cookieAccessHelp" href="https://support.google.com/drive?p=enable_storage_access" class="primary-button button">Learn more</a></div></div></div>

0 comments on commit e9c8e78

Please sign in to comment.