Releases: kalaspuff/stockholm
Releases · kalaspuff/stockholm
0.4.2
- Added support for conversion to and from Protocol Buffers using the new
Money.from_protobuf
ormoney.as_protobuf
functions. By default using thegoogle.type.Money
protobuf definition. - Instantiation of monetary object by passing JSON data and the possibility to get a JSON string based on a monetary amount object.
- Added documentation. Mostly regarding the use and examples about Protocol Buffers, but also a whole new section about the properties that are available on the
stockholm.Money
object.
0.4.1
- Updated versions for test suite (
flake8
,pytest
,mypy
, among others) and then corrected a newly found type hinting issue tracked down by the updated versions. - Added target-versions of the supported Python versions for
black
to not accidentally break any backwards compatibility. - Fixes default decimal digit formatting of the Ugandan shilling (currency code UGX). [Thanks @tritas]
0.4.0
- Added a sub type of
Money
which is namedRate
, which mostly works the same way but doesn't support currencies. In many applications monetary values can be multiplied with rates (the rate can for example be the units of an item on an invoice, where the sum of the item row would be the item price multiplied with the rate). TheRate
sub type is merely for differentiating monetary values (which fully supports currencies) from the simpler rate type. - Updated type hinting and object creation methods to work with inheritance.
0.3.7
- Monetary amounts can also be exported to
dict
as well as created withdict
value inputs, which can be great to for example transport a monetary value in JSON. - To return a dict from a
stockholm.Money
object it can either be casted todict
(dict(money)
) or by usingmoney.asdict()
. - Monetary amounts can also be created using dict input either by using
Money.from_dict(input_dict)
or by calling the constructor directly withdict
input such asMoney(dict_input)
.
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
- Adds method
to_sub_units()
on monetary amounts which for most currencies multiplies the value with 100, but for example forstockholm.currency.JPY
wouldn't change the value at all. - Adds method
to_currency(currency)
(and shortedto(currency)
) on monetary amounts which just changes the currency of the monetary amount without any kind of changes to the amount itself.