=====
price
=====

Price is a class for manipulate prices.

Initialing the class
====================

For initialing the class you need to specifiy a price (included_tax price)
with the value of vat (in %)::

    >>> from price import Price
    >>> price = Price(119.6, vat=19.6)

You could now acces of all attributes::

    >>> price.included_tax
    119.59999999999999
    >>> price.amount_vat
    19.599999999999994
    >>> price.without_tax
    100.0
    >>> price.vat
    19.600000000000001

You could initialise the instance with an included_tax price but also with a
without_tax price::

    >>> price = Price(without_tax=100, vat=5.5)
    >>> price.included_tax
    105.5
    >>> price.amount_vat
    5.5
    >>> price.without_tax
    100.0
    >>> price.vat
    5.5

If you initialing the class without a vat value, the vat will be set to 0%::

    >>> price = Price(119.6)
    >>> price.included_tax
    119.59999999999999
    >>> price.amount_vat
    0.0
    >>> price.without_tax
    119.59999999999999
    >>> price.vat
    0.0


You could re-initialing the instance with an included_tax price::

    >>> price = Price(without_tax=100, vat=5.5)
    >>> price.included_tax = 13
    >>> price.amount_vat
    0.6777251184834121
    >>> price.without_tax
    12.322274881516588

Or with a without_tax price::

    >>> price.without_tax = 13
    >>> price.amount_vat
    0.71499999999999997
    >>> price.included_tax
    13.715


But you could'nt re-initialing the vat attribute, if you want change the vat
you need to call a new instance of the class::

    >>> price.vat = 19.6
    Traceback (most recent call last):
    [...]
    AttributeError: It's forbidden to set directly the vat attribute

If you call the instance, it'll return a dictionnary with the attributes::

    >>> price()
    {'without_tax': 13, 'included_tax': 13.715, 'amount_vat':
    0.71499999999999997, 'vat': 5.5}
