Python module defining constants for month numbers? - Stack Overflowmost recent 30 from stackoverflow.com2026-04-14T16:09:21Zhttps://stackoverflow.com/feeds/question/76028482https://creativecommons.org/licenses/by-sa/4.0/rdfhttps://stackoverflow.com/q/760284822Python module defining constants for month numbers?Juan A. Navarrohttps://stackoverflow.com/users/3591782023-04-16T14:53:56Z2023-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>