code: def weekdays(start, end):
      
      # don't bother calculating anything for the same inputted date
      if start == end:
          return int(start.isoweekday() not in (6, 7))
      elif end < start:
          return -weekdays(end, start)
      else:
          strt_weekday = start.isoweekday()
          end_weekday = end.isoweekday()
  
          # calculate in the positive direction
          if end < start:
              return -weekdays(end, start)
  
          # calculate from the monday after the start
          if 5 < strt_weekday:
              start = start + datetime.timedelta(days=8 - strt_weekday)
  
          # calculate from the friday before the end
          if 5 < end_weekday:
              end = end - datetime.timedelta(days=end_weekday - 5)
  
          remainder = end.isoweekday() - start.isoweekday()
          end = end - datetime.timedelta(days=remainder)
  
          # if the end is now before the start, then both dates fell on a weekend
          if end < start:
              return 0
  
          # otherwise, if the dates normalized to each other, then return the
          # remainder
          elif end == start:
              return remainder + 1
  
          # remove the number of weekends from the start and end dates
          days = ((end - start).days + 1)
          total_days = abs(days)
          multiplier = days / total_days
          weekends = int(round(total_days / 7.0) * 2)
          week_days = ((total_days - weekends) + remainder) * multiplier
  
          return week_days
docs: Returns the number of weekdays between the inputted start and end dates.
      This would be the equivalent of doing (end - start) to get the number of
      calendar days between the two dates.
      
      :param      start | <datetime.date>
                  end   | <datetime.date>
      
      :return     <int>