import decimal


def split_amount(amount, splits, places=2):
    """Return list of ``splits`` amounts where sum of items equals ``amount``.

    >>> from decimal import Decimal
    >>> split_amount(Decimal('12'), 1)
    Decimal('12.00')
    >>> split_amount(Decimal('12'), 2)
    [Decimal('6.00'), Decimal('6.00')]

    Amounts have a max of ``places`` decimal places. Last amount in the list
    may not be the same as others (will always be lower than or equal to
    others).

    >>> split_amount(Decimal('100'), 3)
    [Decimal('33,34'), Decimal('33,34'), Decimal('33,32')]
    >>> split_amount(Decimal('100'), 3, 4)
    [Decimal('33,3334'), Decimal('33,3334'), Decimal('33,3332')]
    >>> split_amount(Decimal('12'), 7)  # Doctest: +ELLIPSIS
    [Decimal('1.72'), ..., Decimal('1.72'), ..., Decimal('1.68')]
    >>> split_amount(Decimal('12'), 17)  # Doctest: +ELLIPSIS
    [Decimal('0.71'), ..., Decimal('0.71'), Decimal('0.64')]

    """
    one = decimal.Decimal(10) ** -places
    amount = amount.quantize(one)
    with decimal.localcontext() as decimal_context:
        decimal_context.rounding = decimal.ROUND_UP
        upper_split = (amount / splits).quantize(one)
    splitted_amounts = [upper_split] * (splits - 1)
    lower_split = amount - sum(splitted_amounts)
    splitted_amounts.append(lower_split)
    return splitted_amounts