Skip to content

Instantly share code, notes, and snippets.

View Davey-Hughes's full-sized avatar

Davey Hughes Davey-Hughes

  • 21:04 (UTC -08:00)
View GitHub Profile
@Davey-Hughes
Davey-Hughes / README.md
Last active December 22, 2021 19:27
Download CO Covid Outbreak File

Notes

  • if __name__ == '__main__' is just convention to create a main() entry point for the code
  • Command line arguments can easily be added importing sys and using the sys.argv list
  • Argparse can also be used to create more rich argument like this
  • This basic version uses wget to download the file it found. You can add more arguments to wget using the existing subprocess.run() function
  • wget has some helpful options that may be considered depending on preference:
    • --no-clobber or -nc won't download a file that has the same name
    • -N will overwrite a file that has the same name
    • -O can be used to specify a file output name. This can be useful if a standardized file name is required (such as using the current date)
  • curl can be used instead of the requests library [like this](https://github.com/Davey-Hughes/hltv_stats/blob/master/src/