Stockholm

Latest version: v0.5.7

Safety actively analyzes 629959 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

0.4.0

* 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

* 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

* Project documentation improvements.
* Removed debug output on currency imports.

---

0.3.5

* 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

* 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

* Added `sub_units` property of money objects for easy conversion to and from sub_units.

---

Page 3 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.