title: Parsing human-readable datetime durations in Python
body: <p>Many common human-readable datetimes can be parsed using <code>datetime.strptime()</code>, for example:</p>
  
  <pre><code>'15 March 2019 13:00'
  </code></pre>
  
  <p>And I know of several Python packages that parse "fuzzy" human-readable datetimes into Python datetime objects, such as <a href="https://pypi.org/project/dateparser/" rel="noreferrer">dateparser</a> and <a href="https://pypi.org/project/parsedatetime/" rel="noreferrer">parsedatetime</a>, which can parse strings such as:</p>
  
  <pre><code>'yesterday'
  'next week'
  </code></pre>
  
  <p>But is there a Python library that can parse common human-readable <strong>datetime durations</strong> into <strong>start and end datetime</strong> objects. For example:</p>
  
  <pre><code>'5 March 2019 13:00-18:30'
  '5 March 2019 1:00-5:30pm'
  '15-18 March 2019'
  '2nd to 22nd March 2019'
  </code></pre>
  
  <p>into:</p>
  
  <pre><code>[datetime.datetime(2019, 3, 5, 13, 0), datetime.datetime(2019, 3, 5, 18, 30)]
  [datetime.datetime(2019, 3, 5, 13, 0), datetime.datetime(2019, 3, 5, 18, 30)]
  [datetime.datetime(2019, 3, 15, 0, 0), datetime.datetime(2019, 3, 18, 0, 0)]
  [datetime.datetime(2019, 3, 2, 0, 0), datetime.datetime(2019, 3, 22, 0, 0)]
  </code></pre>
  
  <p>or take a string like:</p>
  
  <pre><code>'15-17 March 2019'
  </code></pre>
  
  <p>and return a <strong>list of inclusive dates</strong>?</p>
  
  <pre><code>[datetime.datetime(2019, 3, 15, 0, 0), datetime.datetime(2019, 3, 16, 0, 0), datetime.datetime(2019, 3, 17, 0, 0)]
  </code></pre>
  
  <p>Note that I'm interested in parsing specific dates and times rather than non-calendar-based durations such as <code>'2 days'</code> or <code>'three weeks'</code>.</p>