Skip to content
/ acc Public

A Python implementation of Accounting Pattern by Martin Fowler

License

Notifications You must be signed in to change notification settings

knoguchi/acc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acc

A Python implementation of Accounting Patterns framework by Martin Fowler. It may not necessarily represent MF's design.

Accounting Patterns

  • Essentially it's a movement of money from an Account to another.
  • Movement of quantity can be expressed as AccountingEvent and Entry
  • Movement is not always single entry. AccountingTransaction supports multi-legged entries.
  • The movement is governed by Agreements and PostingRules.
  • There are 3 patterns of adjustment. A general rule is
    1. Cancel(Replace) -- use ReplaceAdjustment to remove the original transaction, and add a new one as necessary. This is possible when the original transaction (event) has no subsequent events. It's practical but not GAAP compliant.
    2. Reverse -- add entries with negated amount. This is the most common case that keeps both of the erratic and correct entries.
    3. Adjust difference -- use DifferenceAdjustment when the original transaction is already closed, and you need to create a new entry for the adjustment.

Example

See tests/electricity.py and tests/test_electricity.py

TODO

  • Remove Java-ism.
  • Create general purpose accouting mixin that supports any quantifiable.

References

About

A Python implementation of Accounting Pattern by Martin Fowler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages