Beancount.Directives.Custom (beancount_ex v0.6.0)

Copy Markdown View Source

The custom directive is a generic, user-defined directive.

See Custom.

Beancount syntax

2026-01-01 custom "budget" Expenses:Food #monthly 400.00 USD

General form: YYYY-MM-DD custom "Type" Value...

Elixir struct

%Beancount.Directives.Custom{
  date: ~D[2026-01-01],
  type: "budget",
  values: [
    Beancount.account_value("Expenses:Food"),
    Beancount.tag_value("monthly"),
    Beancount.amount_value(Decimal.new("400.00"), "USD")
  ],
  metadata: %{}
}

Or use Beancount.custom/4:

Beancount.custom(~D[2026-01-01], "budget", [
  Beancount.account_value("Expenses:Food"),
  Beancount.tag_value("monthly"),
  Beancount.amount_value(Decimal.new("400.00"), "USD")
])

Plain strings, Decimal, Date, booleans, and atoms are also valid values.

Fields

Summary

Types

t()

@type t() :: %Beancount.Directives.Custom{
  date: Date.t(),
  metadata: map(),
  type: String.t(),
  values: [term()]
}