piecash.core.transaction module

class piecash.core.transaction.Split(account, value, quantity=None, transaction=None, memo='', action='', reconcile_date=None, reconcile_state='n', lot=None)[source]

Bases: piecash._declbase.DeclarativeBaseGuid

A GnuCash Split.

Note

A split used in a scheduled transaction has its main attributes in form of slots.

transaction

piecash.core.transaction.Transaction – transaction of the split

account

piecash.core.account.Account – account of the split

lot

piecash.business.Lot – lot to which the split pertains

memo

str – memo of the split

value

decimal.Decimal – amount express in the currency of the transaction of the split

quantity

decimal.Decimal – amount express in the commodity of the account of the split

reconcile_state

str – ‘n’, ‘c’ or ‘y’

reconcile_date

datetime.datetime – time

action

str – describe the type of action behind the split (free form string but with dropdown in the GUI

class piecash.core.transaction.Transaction(currency, description='', notes=None, splits=None, enter_date=None, post_date=None, num='')[source]

Bases: piecash._declbase.DeclarativeBaseGuid

A GnuCash Transaction.

currency

piecash.core.commodity.Commodity – currency of the transaction. This attribute is write-once (i.e. one cannot change it after being set)

description

str – description of the transaction

enter_date

datetime.datetime – time at which transaction is entered

post_date

datetime.datetime – day on which transaction is posted

num

str – user provided transaction number

splits

list of Split – list of the splits of the transaction

scheduled_transaction

ScheduledTransaction – scheduled transaction behind the transaction

notes

str – notes on the transaction (provided via a slot)

calculate_imbalances()[source]

Calculate value and quantity imbalances of a transaction

class piecash.core.transaction.ScheduledTransaction(*args, **kwargs)[source]

Bases: piecash._declbase.DeclarativeBaseGuid

A GnuCash Scheduled Transaction.

Attributes
adv_creation (int) : days to create in advance (0 if disabled) adv_notify (int) : days to notify in advance (0 if disabled) auto_create (bool) : auto_notify (bool) : enabled (bool) : start_date (datetime.datetime) : date to start the scheduled transaction last_occur (datetime.datetime) : date of last occurence of the schedule transaction end_date (datetime.datetime) : date to end the scheduled transaction (num/rem_occur should be 0) instance_count (int) : name (str) : name of the scheduled transaction num_occur (int) : number of occurences in total (end_date should be null) rem_occur (int) : number of remaining occurences (end_date should be null) template_account (piecash.core.account.Account): template account of the transaction
class piecash.core.transaction.Lot(title, account, notes='', splits=None, is_closed=0)[source]

Bases: piecash._declbase.DeclarativeBaseGuid

A GnuCash Lot. Each lot is linked to an account. Splits in this account can be associated to a Lot. Whenever the balance of the splits goes to 0, the Lot is closed (otherwise it is opened)

is_closed

int – 1 if lot is closed, 0 otherwise

account

piecash.core.account.Account – account of the Lot

splits

piecash.core.transaction.Split – splits associated to the Lot