Skip to content

Commit

Permalink
made sure that github groups the scraped parts nicely
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed May 5, 2024
1 parent cc0f725 commit 56c309d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
CONNECTUM_OAUTH_CLIENT_ID: ${{ secrets.CONECTUM_OAUTH_CLIENT_ID }}
CONNECTUM_OAUTH_CLIENT_SECRET: ${{ secrets.CONECTUM_OAUTH_CLIENT_SECRET }}
working-directory: data/external
- continue-on-error: true # a PR deleting all data will be created if this fails => fail obvious
run: ls -lah data/external/results
- continue-on-error: true # a PR deleting all data will be created if this fails => fail obvious
run: du -sh data/external/results/*
- name: Fix linting errors
continue-on-error: true
uses: pre-commit/[email protected]
Expand Down
14 changes: 11 additions & 3 deletions data/external/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,29 @@ def ensure_is_empty(directory: Path):
setup_logging(level=logging.INFO)
ensure_is_empty(CACHE_PATH)

print("::group::downloading TUMonline information")
tumonline.scrape_buildings()
tumonline.scrape_rooms()
tumonline.scrape_usages()
tumonline.scrape_orgs(lang="de")
tumonline.scrape_orgs(lang="en")
print("::endgroup::")

print("::group::downloading NAT information")
os.makedirs(CACHE_PATH / "nat", exist_ok=True)
nat.scrape_buildings()
nat.scrape_rooms()
print("::endgroup::")

print("::group::downloading public_transport information")
os.makedirs(CACHE_PATH / "public_transport", exist_ok=True)
public_transport.scrape_stations()
print("::endgroup::")

print("::group::downloading MyTUM information")
os.makedirs(CACHE_PATH / "maps" / "roomfinder", exist_ok=True)
os.makedirs(CACHE_PATH / "maps" / "roomfinder" / "kmz", exist_ok=True)
roomfinder.scrape_buildings()
roomfinder.scrape_rooms()
roomfinder.scrape_maps()

os.makedirs(CACHE_PATH / "public_transport", exist_ok=True)
public_transport.scrape_stations()
print("::endgroup::")

0 comments on commit 56c309d

Please sign in to comment.