Skip to content

Instantly share code, notes, and snippets.

import ftplib
# connect to the server
ftp = ftplib.FTP('ftp.ncdc.noaa.gov') #pass the url without protocol
ftp.login() #pass credentials if anonymous access is not allowed
# switch to the directory containing the data
ftp.cwd('/pub/data/swdi/database-csv/v2/')
ftp.pwd()
@veeruds
veeruds / YouTube-OAuth-Snippets
Created September 11, 2020 14:49 — forked from CoreyMSchafer/YouTube-OAuth-Snippets
YouTube-OAuth-Snippets
# token.pickle stores the user's credentials from previously successful logins
if os.path.exists('token.pickle'):
print('Loading Credentials From File...')
with open('token.pickle', 'rb') as token:
credentials = pickle.load(token)
# Google's Request
from google.auth.transport.requests import Request