This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A double-entry bookkeeping module for django

Project Description

A double-entry bookkeeping system originally developed for SwingTix.

Hello, World

You’ll need a django project. If you don’t have one handy, you can make an empty one following the first steps of the django tutorial. Afterwards, edit <yourproject>/settings.py to add “swingtix.bookkeeper” to INSTALLED_APPS and run:

$ python manage.py syncdb

Then you’re ready to start exploring using the shell:

$ python manage.py shell

First, let’s create a couple of accounts:

>>> from swingtix.bookkeeper.models import BookSet, Account

>>> book = BookSet(description="my book")
>>> book.save()

>>> revenue  = Account(bookset=book, name="revenue", positive_credit=True)
>>> revenue.save()
>>> bank     = Account(bookset=book, name="bank",    positive_credit=False)
>>> bank.save()
>>> expense  = Account(bookset=book, name="expense", positive_credit=False)
>>> expense.save()

Then you can use them:

>>> book = BookSet.objects.get(description="my book")
>>> revenue = book.get_account("revenue")
>>> bank    = book.get_account("bank")
>>> expense = book.get_account("expense")

#Someone pays you can advance.  Yay!
>>> bank.debit(120.00, revenue, "our first sale")
(<AccountEntry: 120 >, <AccountEntry: -120 >)

#but now you have to do some work.  The local coffee shop has free wifi..
>>> bank.credit(2.20, expense, "coffee")
(<AccountEntry: -2 >, <AccountEntry: 2 >)

>>> bank.balance()
Decimal('117.80')
>>> expense.balance()
Decimal('2.20')
>>> revenue.balance()
Decimal('120.00')
Release History

Release History

This version
History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1.1

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
swingtix-bookkeeper-0.0.6.tar.gz (26.0 kB) Copy SHA256 Checksum SHA256 Source Feb 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting