Skip to content

Commit

Permalink
First fully working iteration. Except one needs to manually write out…
Browse files Browse the repository at this point in the history
… the json.
  • Loading branch information
scottbarnes committed Dec 10, 2021
1 parent b65d657 commit 1761909
Showing 1 changed file with 26 additions and 49 deletions.
75 changes: 26 additions & 49 deletions climbers_guide_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,42 @@

### Config ###

INPUT_FILES=[
"/home/scott/Documents/A_Climbers_Guide/yosemite_valley.html",
# "/home/scott/Documents/A_Climbers_Guide/palisades.html",
]

# INPUT_FILES=[
# "/home/scott/Documents/A_Climbers_Guide/mono_pass_to_pine_creek_pass.html",
# "/home/scott/Documents/A_Climbers_Guide/kaweahs_great_western_divide.html",
# "/home/scott/Documents/A_Climbers_Guide/palisades_to_kearsarge_pass.html",
# "/home/scott/Documents/A_Climbers_Guide/bond_to_tioga_other_peaks.html",
# "/home/scott/Documents/A_Climbers_Guide/mammoth_pass_to_mono_pass.html",
# "/home/scott/Documents/A_Climbers_Guide/evolution_black_divide.html",
# "/home/scott/Documents/A_Climbers_Guide/minarets_ritter_range.html",
# "/home/scott/Documents/A_Climbers_Guide/palisades.html",
# "/home/scott/Documents/A_Climbers_Guide/kings-kern_divide.html",
# "/home/scott/Documents/A_Climbers_Guide/yosemite_valley.html",
# "/home/scott/Documents/A_Climbers_Guide/cathedral_range.html",
# "/home/scott/Documents/A_Climbers_Guide/mount_humphreys.html",
# "/home/scott/Documents/A_Climbers_Guide/sawtooth_ridge.html",
# "/home/scott/Documents/A_Climbers_Guide/leconte_divide.html",
# "/home/scott/Documents/A_Climbers_Guide/kings_canyon.html",
# "/home/scott/Documents/A_Climbers_Guide/clark_range.html",
# "/home/scott/Documents/A_Climbers_Guide/whitney.html",
# # "/home/scott/Documents/A_Climbers_Guide/palisades.html",
# ]

INPUT_FILES=[
"/home/scott/Documents/A_Climbers_Guide/mono_pass_to_pine_creek_pass.html",
"/home/scott/Documents/A_Climbers_Guide/kaweahs_great_western_divide.html",
"/home/scott/Documents/A_Climbers_Guide/palisades_to_kearsarge_pass.html",
"/home/scott/Documents/A_Climbers_Guide/bond_to_tioga_other_peaks.html",
"/home/scott/Documents/A_Climbers_Guide/mammoth_pass_to_mono_pass.html",
"/home/scott/Documents/A_Climbers_Guide/evolution_black_divide.html",
"/home/scott/Documents/A_Climbers_Guide/minarets_ritter_range.html",
"/home/scott/Documents/A_Climbers_Guide/palisades.html",
"/home/scott/Documents/A_Climbers_Guide/kings-kern_divide.html",
"/home/scott/Documents/A_Climbers_Guide/yosemite_valley.html",
"/home/scott/Documents/A_Climbers_Guide/cathedral_range.html",
"/home/scott/Documents/A_Climbers_Guide/mount_humphreys.html",
"/home/scott/Documents/A_Climbers_Guide/sawtooth_ridge.html",
"/home/scott/Documents/A_Climbers_Guide/leconte_divide.html",
"/home/scott/Documents/A_Climbers_Guide/kings_canyon.html",
"/home/scott/Documents/A_Climbers_Guide/clark_range.html",
"/home/scott/Documents/A_Climbers_Guide/whitney.html",
]

### End config ###

## Manual adjustments and notes
# Use http://www.highsierratopix.com/high-sierra-map/map.php to help locate passes.
# Just look at the git repository for the HTML files for any adjustments.


# Dataclasses for:
# regions
# - intro
# - the historical resume, topography, approaches & campsites, passes, and peaks for the region
# historical resume
# - region
# topography and its relation to climbing
# - region
# approaches and campsites
# - direction
# - region
# principal passes
# - name
# - class
# - elevation
# - region
# - description
# peaks
# - name
# - elevation (list?)
# - routes {set of the routes or whatever}
# - region
# routes
# - route # / name
# - peak
# - class
# - description
# Output
# In [40]: for i, p in enumerate(passes):
# ...: with open('output.txt', 'a') as outfile:
# ...: json.dump(asdict(passes[i]), outfile, indent=4)
# ...:

@dataclass
class Region:
Expand Down

0 comments on commit 1761909

Please sign in to comment.