Python module defining constants for month numbers? - Stack Overflow most recent 30 from stackoverflow.com 2026-04-14T16:09:21Z https://stackoverflow.com/feeds/question/76028482 https://creativecommons.org/licenses/by-sa/4.0/rdf https://stackoverflow.com/q/76028482 2 Python module defining constants for month numbers? Juan A. Navarro https://stackoverflow.com/users/359178 2023-04-16T14:53:56Z 2023-04-16T14:53:56Z <p>The <code>calendar</code> module defines constants e.g. <code>MONDAY</code> (0), <code>TUESDAY</code> (1), etc. for the <a href="https://docs.python.org/3/library/calendar.html#calendar.MONDAY" rel="nofollow noreferrer">days of the week</a>.</p> <p>And the source code even <a href="https://github.com/python/cpython/blob/main/Lib/calendar.py#L41" rel="nofollow noreferrer">defines</a> (but does not export) constants for <code>January</code> (1) and <code>February</code> (2), but not the rest of the months.</p> <p>I can of course throw in a dozen of these definitions in a small module of my own. But given how common these must be, I'm left wondering:</p> <p><strong>Is there a standard python module defining constants for all of the months?</strong></p>