This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import urllib | |
import pandas | |
import json | |
import itertools | |
import os | |
BASE = "https://2014.spaceappschallenge.org/awards/#globalnom" | |
GOOGLE_GEOCODE_URL = 'https://maps.googleapis.com/maps/api/geocode/json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from StringIO import StringIO | |
from pprint import pprint | |
from PIL import Image | |
from numpy import array | |
base = "https://api.data.gov/nasa/planetary/earth" | |
payload = { | |
"lon": -122.066133, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib | |
BASE = "http://beta.gfw-apis.appspot.com/forest-change/forma-alerts" | |
period = "2008-01-01,2012-09-24" | |
sample_area = { | |
"geometry": { | |
"type": "Polygon", | |
"coordinates": [ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample code to demonstrate the vegetation extraction from satellite imagery. | |
# The example region is a small plot in the central valley: | |
# https://gist.github.com/danhammer/47590518ece27c2ef0ab | |
# Specifically, this reports the mean and standard deviation EVI score for all | |
# 30m pixels within the supplied polygon. To install the requests package on a | |
# Mac, type `sudo pip install requests` or visit this page for more comprehensive | |
# install instructions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample code to identify buildings withing a supplied bounding box. | |
import requests | |
def grabber(bbox, residential=True): | |
BASE = "http://wolak.enviro-service.appspot.com/buildings" | |
payload = bbox | |
payload['residential'] = residential | |
res = requests.get(BASE, params=payload).json() | |
return res |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clean jobs data | |
import requests | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
def collect_links(category_idx=231): | |
# Collect the links to individual jobs given by the supplied category index | |
LIST_BASE = "https://www.higheredjobs.com/faculty/search.cfm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib | |
def census_tract(street_address, city, state): | |
""" | |
Accepts an address -- split into street number, city, and state -- and | |
returns the census tract number as a string. | |
Example: |