forked from codeforamerica/ohhs_Falcon
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from migurski/oakland-soft-story
Added data scripts we are actually using.
- Loading branch information
Showing
12 changed files
with
6,579 additions
and
239 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from csv import DictReader | ||
from re import sub | ||
import json | ||
|
||
if __name__ == '__main__': | ||
|
||
statuses = list() | ||
|
||
with open('statuses-2014-08-25.csv', 'rU') as f: | ||
for row in DictReader(f, dialect='excel'): | ||
if row['latitude']: | ||
statuses.append(row) | ||
statuses[-1]['latitude'] = float(statuses[-1]['latitude']) | ||
statuses[-1]['longitude'] = float(statuses[-1]['longitude']) | ||
|
||
for status in statuses: | ||
id = sub(r'\W', '-', status['address']) | ||
with open('parcels/{0}.json'.format(id), 'w') as f: | ||
json.dump(status, f, indent=2, sort_keys=True) |
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 file was deleted.
Oops, something went wrong.
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh -ex | ||
rm -rf tiles && mkdir -p tiles && python import-tiles.py | ||
rm -rf parcels && mkdir -p parcels && python import-parcels.py | ||
tar -czL --disable-copyfile - soft-story | ssh benzene "rm -rf /tmp/soft-story && tar -C /tmp -xzvf - && ls -l /tmp/soft-story && s3put -a $AWS_KEY -s $AWS_SECRET -b data.codeforamerica.org -g public-read -p /tmp /tmp/soft-story" |
Oops, something went wrong.