Skip to content

Instantly share code, notes, and snippets.

View gotdang's full-sized avatar
💭
Encouraging

Dang gotdang

💭
Encouraging
  • Two Fish Creative
  • Florida, USA
View GitHub Profile
@mikecharles
mikecharles / README.md
Last active December 1, 2022 08:50
Validate command line date argument in Python

Validates a --dates argument in Python with the following possible formats:

  • YYYYMMDD (eg. 20120515)
  • YYYYMMDD-YYYYMMDD (eg. 20140115-20140315)
  • yesterday
  • today

To use this function, reference it in the argparse setup: