Skip to content

Commit 7644f46

Browse files
Michelle JanowieckiMichelle Janowiecki
Michelle Janowiecki
authored and
Michelle Janowiecki
committed
fixed small errors for slug and find/replace
1 parent a7384f4 commit 7644f46

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

cleanUpGeoCSV.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ def addDictonary(columnName, vocab):
5050
df['title'] = df['title'].str.rstrip('/.')
5151
df['description'] = df['description'].str.replace('|', ' ')
5252
df['description'] = df['description'].str.replace(' ', ' ')
53-
df['description'] = df['description'].str.replace('p. ', 'page ')
54-
df['description'] = df['description'].str.replace('col. ', 'color ')
55-
df['description'] = df['description'].str.replace('ill. ', 'illlustration(s) ')
53+
df['description'] = df['description'].str.replace(' p. ', ' page ')
54+
df['description'] = df['description'].str.replace(' col. ', ' color ')
55+
df['description'] = df['description'].str.replace(' ill. ', ' illlustration(s) ')
5656
df['scale'] = df['scale'].str.rstrip(':;,')
57-
df['scale'] = df['scale'].replace('ca.', 'approximately')
58-
df['scale'] = df['scale'].replace('in.', 'inch')
57+
df['scale'] = df['scale'].replace(' ca.', ' approximately')
58+
df['scale'] = df['scale'].replace(' in.', ' inch')
5959
df['description'] = df['title']+'. '+df['description']+' '+df['scale']
6060
df['rights'] = 'Public'
6161
df['suppressed'] = 'False'

convertGeoCSVToGeoJSON.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
parser = argparse.ArgumentParser()
99
parser.add_argument('-f', '--file')
1010
parser.add_argument('-p', '--prov')
11-
parser.add_argument('-b', '--baseURL')
1211
args = parser.parse_args()
1312

1413
if args.file:
@@ -19,10 +18,6 @@
1918
prov = args.prov
2019
else:
2120
prov = input('Enter provenance information: ')
22-
if args.baseURL:
23-
baseURL = args.baseURL
24-
else:
25-
baseURL = input('Enter the baseURL of your GeoBlacklight instance: ')
2621

2722

2823
def fixGeom(json_file, key, value):
@@ -97,9 +92,8 @@ def addIdentifierAndSlug(row):
9792
id = row.get('identifier')
9893
if id is None:
9994
id = uuid.uuid4()
100-
slug = baseURL+id
10195
json_file['dc_identifier_s'] = id
102-
json_file['layer_slug_s'] = slug
96+
json_file['layer_slug_s'] = id
10397
else:
10498
addToDict(json_file, 'dc_identifier_s', 'identifier')
10599
addToDict(json_file, 'layer_slug_s', 'layer_slug')

0 commit comments

Comments
 (0)