This file contains 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 | |
charged = open("charged.html","r") | |
soup = BeautifulSoup(charged, 'html.parser') | |
results = soup.find_all(class_="callnum") | |
n = [] |
This file contains 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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script> | |
var ajaxOpts = { | |
dataType:"jsonp", | |
url:"http://api.neotomadb.org/v1/data/sites", | |
data:{"loc":"-93.0546875,44.36209301204985,-89.0546875,48.36209301204985"}, | |
success: logger | |
} |
This file contains 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
''' | |
This is operating on a SQLite file which was generated using the following command to filter out entries with the same origin and destination | |
ogr2ogr -f SQLite -sql "SELECT * FROM usa_ttw_master WHERE NOT (O_STATEFP = D_STATEFP AND O_COUNTYFP = D_COUNTYFP AND O_TRACTCE = D_TRACTCE)" commutes_without_sameorigins.sqlite *.shp | |
The result of that command is a database with 4080575 entries. The original Shapefile had 4156426 entries, so 75851 same-origin entries were filtered out. | |
''' | |
from __future__ import print_function |
This file contains 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
# Original by Daniel L. Greenwald | |
# http://dlgreenwald.weebly.com/blog/capitalizing-titles-in-bibtex | |
# Modified by Garrett Dash Nelson | |
import re | |
from titlecase import titlecase | |
# Input and output files | |
my_file = 'library.bibtex' | |
new_file = 'library-capitalized.bibtex' # in case you don't want to overwrite |
This file contains 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 urllib2 | |
import re | |
from string import ascii_uppercase, replace | |
with open('results.tsv','w') as outfile: | |
for letter in ascii_uppercase: | |
This file contains 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
geoid | town | state | <25000 | 25000-49999 | 50000-99999 | 100000-199999 | 200000> | |
---|---|---|---|---|---|---|---|---|
3300933860 | Hanover | 33 | 366 | 229 | 694 | 821 | 759 | |
3300941300 | Lebanon | 33 | 1183 | 1539 | 2120 | 1170 | 313 | |
5002752900 | Norwich | 50 | 145 | 183 | 274 | 450 | 275 | |
3300924340 | Enfield | 33 | 154 | 590 | 551 | 484 | 257 | |
5002732275 | Hartford | 50 | 787 | 905 | 1588 | 868 | 192 | |
3300944260 | Lyme | 33 | 36 | 98 | 153 | 203 | 184 | |
5002785975 | Woodstock | 50 | 147 | 271 | 521 | 256 | 181 | |
3301931220 | Grantham | 33 | 39 | 186 | 349 | 423 | 132 | |
3301352100 | New London | 33 | 266 | 287 | 450 | 558 | 117 |
This file contains 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
{"nodes": [{"name": "Inner Hanover NH"}, {"name": "Groton-Ryegate-Peacham VT"}, {"name": "Rockingham VT"}, {"name": "Enfield NH"}, {"name": "Haverhill NH"}, {"name": "Danbury-Wilmot-Hill NH"}, {"name": "Hartford North of the White River VT"}, {"name": "Lebanon North of Route 4 NH"}, {"name": "Windsor VT"}, {"name": "Lebanon South of Route 4 NH"}, {"name": "Royalton VT"}, {"name": "Springfield Northeast VT"}, {"name": "Outer Hanover NH"}, {"name": "Norwich VT"}, {"name": "Piermont-Orford-Wentworth NH"}, {"name": "Weathersfield VT"}, {"name": "New London NH"}, {"name": "Hartland VT"}, {"name": "Randolph VT"}, {"name": "Newbury VT"}, {"name": "Chelsea-Vershire-Tunbridge-Strafford VT"}, {"name": "Walpole NH"}, {"name": "Bradford VT"}, {"name": "Unity-Acworth-Langdon NH"}, {"name": "Bellows Falls VT"}, {"name": "Charlestown NH"}, {"name": "Claremont Southwest NH"}, {"name": "Claremont Southeast NH"}, {"name": "Plainfield-Cornish NH"}, {"name": "Grantham-Croydon-Springfield NH"}, {"name": "Orange-Washington VT"}, { |
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 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: #fcfcfa; | |
height: 500px; | |
position: relative; | |
width: 960px; | |
} |
This file contains 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 bs4 import BeautifulSoup | |
barcode = "39999059010775" | |
r = requests.get('https://collections.leventhalmap.org/search?page=1&per_page=100&q={}'.format(barcode)) | |
htmlSource = BeautifulSoup(r.text, "html.parser") | |
for d in htmlSource.find_all("div", class_="document"): |
OlderNewer