Skip to content

Releases: kalaspuff/stockholm

0.4.2

29 Jun 20:35
5988134
Compare
Choose a tag to compare
  • Added support for conversion to and from Protocol Buffers using the new Money.from_protobuf or money.as_protobuf functions. By default using the google.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

26 Jun 02:53
0202811
Compare
Choose a tag to compare
  • 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

07 Dec 01:41
bac2c52
Compare
Choose a tag to compare
  • Added a sub type of Money which is named Rate, 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). The Rate 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

28 Nov 21:12
9719241
Compare
Choose a tag to compare
  • Monetary amounts can also be exported to dict as well as created with dict 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 to dict (dict(money)) or by using money.asdict().
  • Monetary amounts can also be created using dict input either by using Money.from_dict(input_dict) or by calling the constructor directly with dict input such as Money(dict_input).

0.3.6

28 Nov 20:03
962f9e5
Compare
Choose a tag to compare
  • Project documentation improvements.
  • Removed debug output on currency imports.

0.3.5

28 Nov 11:40
7e7241b
Compare
Choose a tag to compare
  • Added money() method to currency objects. For example stockholm.Currency.EUR.money(100) would equal stockholm.Money(100, stockholm.Currency.EUR).
  • Prevents currency objects to create new currency objects by using them as object constructors.

0.3.4

27 Nov 23:39
1fe0665
Compare
Choose a tag to compare
  • Added shortcut to round(self, 0) as the method to_integral which also returns a Money object.
  • Added currency_code as a property which outputs the currency in string format.

0.3.3

27 Nov 22:17
317cdfe
Compare
Choose a tag to compare
  • Added sub_units property of money objects for easy conversion to and from sub_units.

0.3.2

27 Nov 21:40
b67093d
Compare
Choose a tag to compare
  • Updated README with examples about units and nanos properties.
  • Added get_currency(ticker) method available directly from root package, to make it importable with from stockholm import get_currency.

0.3.1

27 Nov 20:57
e2b13e5
Compare
Choose a tag to compare
  • Adds method to_sub_units() on monetary amounts which for most currencies multiplies the value with 100, but for example for stockholm.currency.JPY wouldn't change the value at all.
  • Adds method to_currency(currency) (and shorted to(currency)) on monetary amounts which just changes the currency of the monetary amount without any kind of changes to the amount itself.