piecash._common module

exception piecash._common.GnucashException[source]

Bases: Exception

exception piecash._common.GncNoActiveSession[source]

Bases: piecash._common.GnucashException

exception piecash._common.GncValidationError[source]

Bases: piecash._common.GnucashException

exception piecash._common.GncImbalanceError[source]

Bases: piecash._common.GncValidationError

exception piecash._common.GncConversionError[source]

Bases: piecash._common.GnucashException

class piecash._common.Recurrence(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.DeclarativeBase

Recurrence information for scheduled transactions

obj_guid

link to the parent ScheduledTransaction record.

Type

str

recurrence_mult

Multiplier for the period type. Describes how many times the period repeats for the next occurrence.

Type

int

recurrence_period_type

type or recurrence (monthly, daily).

Type

str

recurrence_period_start

the date the recurrence starts.

Type

date

recurrence_weekend_adjust

adjustment to be made if the next occurrence falls on weekend / non-working day.

Type

str

piecash._common.hybrid_property_gncnumeric(num_col, denom_col)[source]

Return an hybrid_property handling a Decimal represented by a numerator and a denominator column. It assumes the python field related to the sqlcolumn is named as _sqlcolumn.

Returns

sqlalchemy.ext.hybrid.hybrid_property

class piecash._common.CallableList(*args)[source]

Bases: list

A simple class (inherited from list) allowing to retrieve a given list element with a filter on an attribute.

It can be used as the collection_class of a sqlalchemy relationship or to wrap any list (see examples in piecash.core.session.GncSession)

get(**kwargs)

Return the first element of the list that has attributes matching the kwargs dict. The get method is an alias for this method.

To be used as:

l(mnemonic="EUR", namespace="CURRENCY")
piecash._common.get_system_currency_mnemonic()[source]

Returns the mnemonic of the locale currency (and EUR if not defined).

At the target, it could also look in Gnucash configuration/registry to see if the user has chosen another default currency.