Skip to content

model

Drebedengi data model & API dictionaries module

Account

Drebedengi account model.

Attributes:

Name Type Description
id int

id is a unique identifier for the account.

budget_family_id int

User family ID (for multiuser mode)

object_type ObjectType

Always ObjectType.ACCOUNT

name str

Account name assigned by the user.

is_hidden bool

True if the account is hidden.

is_autohide bool

True if the account is configured to hide on zero balance.

is_loan bool

True if the account is for loans (both taken and given).

sort int

Sort order of the account.

wallet_user_id int | None

User Id if account is marked as a personal wallet.

icon_id str | None

Account Icon Id.

ActionType

Bases: IntEnum

Enum of possible change action types. Used in ChangeRecord model.

Attributes:

Name Type Description
CREATE int

1

UPDATE int

2

DELETE int

3

ChangeRecord

Drebedengi change record model.

Attributes:

Name Type Description
revision_id int

Revision id.

action_type ActionType

Action type (update, create, delete).

change_object_type ObjectType

changed object type.

object_id int

changed object type id.

date datetime

change date in user set timezone.

Currency

Drebedengi currency model.

Attributes:

Name Type Description
id int

id is a unique drebedengi internal identifier for the currency.

user_name str

A custom currency name assigned by the user.

currency_code str

International 3-leet currency code.

exchange_rate float

Current exchange rate from the default currency to the currency.

budget_family_id int

User family ID (for multiuser mode)

is_default bool

True if the currency is set as default.

is_autoupdate bool

True if the currency is configured to fecth exchange rate automatically.

is_hidden bool

True if the currency is hidden.

ExpenseCategory

Drebedengi expense category model.

Attributes:

Name Type Description
id int

id is a unique identifier for the expense category.

parent_id int

parent_id is the id of the parent expense category. If the expense category has no parent, parent_id is -1.

budget_family_id int

User family ID (for multiuser mode)

object_type ObjectType

Always ObjectType.EXPENSE_CATEGORY

name str

Name of the expense category.

is_hidden bool

True if the expense category is hidden.

sort int

Sort order of the expense category.

IncomeSource

Drebedengi income source model.

Attributes:

Name Type Description
id int

id is a unique identifier for the income source.

parent_id int

parent_id is the id of the parent income source. If the income source has no parent, parent_id is -1.

budget_family_id int

User family ID (for multiuser mode)

object_type ObjectType

Always ObjectType.INCOME_SOURCE

name str

Name of the income source.

is_hidden bool

True if the income source is hidden.

sort int

Sort order of the income source.

ObjectType

Bases: IntEnum

Enum of possible object types. Used in ChangeRecord and other models.

Attributes:

Name Type Description
TRANSACTION int

1

INCOME_SOURCE int

2

EXPENSE_CATEGORY int

3

ACCOUNT int

4

CURRENCY int

5

BUDGET_TAGS int

6

BUDGET_ACCUM int

7

BUDGET_ACCUM_ORDER int

8

ReportFilterType

Bases: IntEnum

Report filter type enum. Used in get_transactions API to configure categories, tags and other filters.

Attributes:

Name Type Description
NONE int

0

SELECTED_ONLY int

1

EXCEPT_SELECTED int

2

ReportGrouping

Bases: IntEnum

Report grouping enum. Used in get_transactions API to configure aggregated report.

Attributes:

Name Type Description
NONE int

1

BY_INCOME_SOURCE int

2

BY_EXPENSE_CATEGORY int

3

ReportPeriod

Bases: IntEnum

Report period enum. Used in get_transactions API to filter by date.

Attributes:

Name Type Description
CUSTOM_PERIOD int

0

THIS_MONTH int

1

TODAY int

7

LAST_MONTH int

2

THIS_QUART int

3

THIS_YEAR int

4

LAST_YEAR int

5

ALL_TIME int

6

LAST_20_RECORD int

8

Tag

Drebedengi tag model.

Attributes:

Name Type Description
id int

id is a unique identifier for the tag.

parent_id int

parent_id is the id of the parent tag. If the tag has no parent, parent_id is -1.

budget_family_id int

User family ID (for multiuser mode)

name str

Name of the tag.

is_hidden bool

True if the tag is hidden.

is_shared bool

True if the tag is shared across family account, otherwise it's user only.

sort int

Sort order of the tag.

Transaction

Drebedengi transaction (aka Record) model.

Attributes:

Name Type Description
id int

transaction id

budget_object_id int

(int) For expenses - expense category; for incomes - income source; for transfers - source account_id, for exchanges - equal to account_id.

user_nuid int

(int) User id.

budget_family_id int

(int) Family id for multi-user mode.

is_loan_transfer bool

(bool) = Makrs trabsfer transactions that went to a "loan" account.

operation_date datetime

(datetime) Operation date in user set timezone.

currency_id int

(int) Transaction currency id.

operation_type TransactionType

(TransactionType) Transaction type.

account_id int

(int) Account id.

amount int

(int) Transaction amount in the original currency multiplied by 100

comment str | None

(str | None) Transaction comment. May be empty

oper_utc_timestamp datetime

System timestamp, no official documentation.

group_id int

Group id if this transaction is part of a group.

TransactionType

Bases: IntEnum

Enum of possible transaction types.

Attributes:

Name Type Description
INCOME int

2

EXPENSE int

3

TRANSFER int

4

EXCHANGE int

5

ANY int

6