Amatino Swift 0.0.11 Released

Amatino Swift 0.0.11 has been released! This is a huge release with wide ranging changes and substantial new features. It is not backwards compatible with 0.0.10, but any code written for 0.0.10 will compile for 0.0.11 with minor adjustments.

  • Almost all asynchronous Amatino methods now accept a (Result<T, Error>) -> Void callback parameter, using the new Swift 5 Result type. The previous (Error?, T?) -> Void parameter remains available. You now have a choice to use either depending on your preferred style.
  • Add Denomination protocol, which codifies the characteristics of CustomUnit and GlobalUnit and allows method signatures accepting either of those classes to be streamlined.
  • Add Denominated protocol, which gives default behaviours to classes denominated in a Denomination, such as Transactions and Ledgers.
  • Renamed many method signatures parameters for more expressive syntax. For example, someMethod(then: (Error?, Object?) rather than someMethod(callback: (Error?, Object?)
  • Remove all use of Int64, replace with Int. Amatino Swift will not function on 32-bit platforms, so the occasional use of Int64 added needless confusion.
  • The AmatinoError case .inconsistentInternalState has been renamed .inconsistentState
  • Publicly exposed Account.create() taking Account.CreateArguments struct. Gives extra flexibility when designing GUI for account creation
  • GlobalUnitList now conforms to the Sequence protocol. I.e. you can loop over the list without needing to access the raw .units property.
  • TheGlobalUnitList units property is now sorted first by GlobalUnit.priority and then alphabetically by GlobalUnit.name
  • AccountType has a new static method, .typeWith(:name), which returns an AccountType with the given name
  • Tree now conforms to the Sequence protocol, iterating over Node conforming objects
  • Multiline strings throughout the library are no longer peppered with \n newlines. For example, AmatinoError messages.
  • Account.CreateArguments now enforces a minimum .name character length of 1.
  • Tree now features a .flatAccounts property, which returns recursive flattened list of all Accounts in the Tree as Node objects. This is effectively a list of all Accounts in an Entity.
  • Add new AccountRepresentative protocol, to which Account, TreeNode and PlaceholderNode conform. Provides base Account metadata – accountId, name, type, and is accepted in many places where Account was formerly required.
  • Fixed an internal typo in Account.DeletionArguments (no effect on public API)
  • Transaction, Balance, Account, Ledger, GlobalUnitList, Performance, Position and Entity methods may no longer throw. Errors are now exclusively handled by the error parameter in respective callbacks.
  • Ledger may now be retrieved with an object conforming to the AccountRepresentative protocol. This saves an intermediary Account retrieval when, for example, retrieving a Ledger based on a Tree node
  • Add User class including create(), retrieve(), delete() methods
  • Add User class lifecycle testing
  • Ledger.nextPage() renamed .retrieveNextPage()
  • RecursiveLedger.nextPage() renamed .retrieveNextPage()
  • Add Session.delete() method

Amatino Swift source code is available on GitHub, and you can add Amatino accounting functionality to your macOS or iOS project via Carthage or CocoaPods.

Amatino Python 0.12 Released

Hot on the heels of 0.0.11, Amatino Python 0.0.12 has been released. 0.0.12 enhances the capabilities of the Position and Performance classes added in 0.0.11, and introduces the new Tree class.

  • Add Tree class
  • Add total account balance properties to Performance
  • Add total account balance properties to Position
  • Add tests for all new features

The new properties in Position and Performance give you quick access to key financial data describing an entity.

print("{name} total assets: ${assets}".format(
   name=mega_corp.name,
   assets='{:,}'.format(position.total_assets)
)
# Example output:
# Mega Corp total assets: $1,543

Check out the Amatino Python documentation to see all the new properties.

The new Tree class is a beast, combining all accounts in an entity into a single recursive object, at a particular balance date. Like Position and Performance, Tree accounts are of type TreeNode, which means you have access to recursive and individual balances and other useful data.

from amatino import Tree
from datetime import datetime

tree = Tree.retrieve(
   entity=mega_corp,
   balance_time=datetime.utcnow()
)

print("{name} equity: ${equity}".format(
   name=mega_corp.name,
   equity='{:,}'.format(tree.total_equity)
)

For detailed documentation of the properties and methods of the Tree class, check out the Amatino Python Documentation.

You can install Amatino via PyPi:

$ pip install amatino

Or, if you already have Amatino Python installed, upgrade:

$ pip install --upgrade amatino

Be sure to leave your feedback on the Amatino discussion forums, or on Twitter, we’d love to hear what you think about Amatino Python.