timerickson/kmy

Add __repr__() to classes

Closed this issue · 1 comments

In order to allow a better navigation with Python REPL and better debugging, it would be nice to implement the representation method [repr()] in some classes such as: User, Institution, FileInfo, Account, Tag, Payee and Transaction.

Currently, if evaluated, those classes are displayed like:

<kmy.kmy.Kmy object at 0x7f8c65467ee0>
<kmy.user.User object at 0x7f8c65467eb0>
<kmy.fileinfo.FileInfo object at 0x7f8c65278df0>
<kmy.institution.Institution object at 0x7f8c65278f40>

I believe that a better way to display those classes would be something like:

Kmy(fileInfo='FileInfo(creationDate='2018-03-01', lastModifiedDate=2021-03-20)', user=User(name='John Johns'))
User(name='John Johns')
FileInfo(creationDate='2018-03-01', lastModifiedDate=2021-03-20)
Institution(name='Bank1'), Institution(name='Bank2')

Fixed by #2