{ "$defs": { "ActionAddTxn": { "description": "Add a transaction to the beancount file.\n\nThis is the default action type. If your action does not specify a type, it will be assumed to be an add transaction action.\n\nThe following keys are available for the add transaction action:\n\n- `file`: output beancount file name to write the transaction to\n- `txn`: the template of the transaction to insert\n\nA transaction template is an object that contains the following keys:\n\n- `id`: the optional `import-id` to overwrite the default one. By default, `{{ file | as_posix_path }}:{{ lineno }}` will be used unless the extractor provides a default value.\n- `date`: the optional date value to overwrite the default one. By default, `{{ date }}` will be used.\n- `flag`: the optional flag value to overwrite the default one. By default, `*` will be used.\n- `narration`: the optional narration value to overwrite the default one. By default `{{ desc | default(bank_desc, true) }}` will be used.\n- `payee`: the optional payee value of the transaction.\n- `tags`: an optional list of tags for the transaction\n- `links`: an optional list of links for the transaction\n- `metadata`: an optional list of `name` and `value` objects as the metadata items for the transaction.\n- `postings`: a list of templates for postings in the transaction.\n\nThe structure of the posting template object looks like this.\n\n- `account`: the account of posting\n- `amount`: the optional amount object with `number` and `currency` keys\n- `price`: the optional amount object with `number` and `currency` keys\n- `cost`: the optional template of cost spec", "properties": { "type": { "const": "add_txn", "default": "add_txn", "enum": [ "add_txn" ], "title": "Type", "type": "string" }, "file": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "File" }, "txn": { "$ref": "#/$defs/TransactionTemplate" } }, "required": [ "txn" ], "title": "ActionAddTxn", "type": "object" }, "ActionDelTxn": { "description": "Delete a transaction from the beancount file.\n\n\nThe following keys are available for the delete transaction action:\n\n- `txn`: the template of the transaction to insert\n\nA deleting transaction template is an object that contains the following keys:\n\n- `id`: the `import-id` value for ensuring transactions to be deleted. By default, `{{ file | as_posix_path }}:{{ lineno }}` will be used unless the extractor provides a default value.", "properties": { "type": { "const": "del_txn", "default": "del_txn", "enum": [ "del_txn" ], "title": "Type", "type": "string" }, "txn": { "$ref": "#/$defs/DeleteTransactionTemplate" } }, "required": [ "txn" ], "title": "ActionDelTxn", "type": "object" }, "ActionIgnore": { "description": "Ignore the transaction.\n\nThis prevents the transaction from being added to the beancount file.\n\nSometimes, we are not interested in some transactions, but if we don't process them, you will still see them\nappear in the \"unprocessed transactions\" section of the report provided by our command line tool.\nTo mark one transaction as processed, you can simply use the `ignore` action like this:\n\n```YAML\n- name: Ignore unused entries\n match:\n extractor:\n equals: \"mercury\"\n desc:\n one_of:\n - Mercury Credit\n - Mercury Checking xx1234\n actions:\n - type: ignore\n```", "properties": { "type": { "const": "ignore", "default": "ignore", "enum": [ "ignore" ], "title": "Type", "type": "string" } }, "title": "ActionIgnore", "type": "object" }, "AmountTemplate": { "properties": { "number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Number" }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Currency" } }, "title": "AmountTemplate", "type": "object" }, "DateAfterMatch": { "description": "To match values after a date, one can do this:\n\n```YAML\nimports:\n- match:\n date:\n date_after: \"2021-01-01\"\n format: \"%Y-%m-%d\"\n```", "properties": { "date_after": { "title": "Date After", "type": "string" }, "format": { "title": "Format", "type": "string" } }, "required": [ "date_after", "format" ], "title": "DateAfterMatch", "type": "object" }, "DateBeforeMatch": { "description": "To match values before a date, one can do this:\n\n```YAML\nimports:\n- match:\n date:\n date_before: \"2021-01-01\"\n format: \"%Y-%m-%d\"\n```", "properties": { "date_before": { "title": "Date Before", "type": "string" }, "format": { "title": "Format", "type": "string" } }, "required": [ "date_before", "format" ], "title": "DateBeforeMatch", "type": "object" }, "DateSameDayMatch": { "description": "To match values with the same day, one can do this:\n\n```YAML\nimports:\n- match:\n date:\n date_same_day: \"2021-01-01\"\n format: \"%Y-%m-%d\"\n```", "properties": { "date_same_day": { "title": "Date Same Day", "type": "string" }, "format": { "title": "Format", "type": "string" } }, "required": [ "date_same_day", "format" ], "title": "DateSameDayMatch", "type": "object" }, "DateSameMonthMatch": { "description": "To match values with the same month, one can do this:\n\n```YAML\nimports:\n- match:\n date:\n date_same_month: \"2021-01-01\"\n format: \"%Y-%m-%d\"\n```", "properties": { "date_same_month": { "title": "Date Same Month", "type": "string" }, "format": { "title": "Format", "type": "string" } }, "required": [ "date_same_month", "format" ], "title": "DateSameMonthMatch", "type": "object" }, "DateSameYearMatch": { "description": "To match values with the same year, one can do this:\n\n```YAML\nimports:\n- match:\n date:\n date_same_year: \"2021-01-01\"\n format: \"%Y-%m-%d\"\n```", "properties": { "date_same_year": { "title": "Date Same Year", "type": "string" }, "format": { "title": "Format", "type": "string" } }, "required": [ "date_same_year", "format" ], "title": "DateSameYearMatch", "type": "object" }, "DeleteTransactionTemplate": { "description": "A transaction delete template.", "properties": { "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "DeleteTransactionTemplate", "type": "object" }, "ExractorInputConfig": { "properties": { "import_path": { "title": "Import Path", "type": "string" }, "as_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "As Name" }, "date_format": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Date Format" }, "datetime_format": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Datetime Format" }, "date_field": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Date Field" } }, "required": [ "import_path" ], "title": "ExractorInputConfig", "type": "object" }, "ImportList": { "description": "The list of import rules.\n\nCan be a list of ImportRule or IncludeRule", "items": { "anyOf": [ { "$ref": "#/$defs/ImportRule" }, { "$ref": "#/$defs/IncludeRule" } ] }, "title": "ImportList", "type": "array" }, "ImportRule": { "description": "An import rule to match and process transactions.\n\nThe following keys are available for the import configuration:\n\n- `name`: An optional name for the user to comment on this matching rule. Currently, it has no functional purpose.\n- `match`: The rule for matching raw transactions extracted from the input CSV files. As described in the Import Match Rule Definition\n- `actions`: Decide what to do with the matched raw transactions, as the Import Action Definition describes.", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Name" }, "common_cond": { "anyOf": [ { "$ref": "#/$defs/SimpleTxnMatchRule" }, { "type": "null" } ], "default": null }, "match": { "anyOf": [ { "$ref": "#/$defs/SimpleTxnMatchRule" }, { "items": { "$ref": "#/$defs/TxnMatchVars" }, "type": "array" } ], "title": "Match" }, "actions": { "items": { "anyOf": [ { "$ref": "#/$defs/ActionAddTxn" }, { "$ref": "#/$defs/ActionDelTxn" }, { "$ref": "#/$defs/ActionIgnore" } ] }, "title": "Actions", "type": "array" } }, "required": [ "match", "actions" ], "title": "ImportRule", "type": "object" }, "IncludeRule": { "description": "Include other yaml files that contain lists of ImportRule", "properties": { "include": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "title": "Include" } }, "required": [ "include" ], "title": "IncludeRule", "type": "object" }, "InputConfig": { "description": "The input configuration for the import rule.", "properties": { "match": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrRegexMatch" } ], "title": "Match" }, "config": { "$ref": "#/$defs/InputConfigDetails" } }, "required": [ "match", "config" ], "title": "InputConfig", "type": "object" }, "InputConfigDetails": { "description": "The input configuration details for the import rule.", "properties": { "extractor": { "$ref": "#/$defs/ExractorInputConfig" }, "default_file": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Default File" }, "prepend_postings": { "anyOf": [ { "items": { "$ref": "#/$defs/PostingTemplate" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Prepend Postings" }, "append_postings": { "anyOf": [ { "items": { "$ref": "#/$defs/PostingTemplate" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Append Postings" }, "default_txn": { "anyOf": [ { "$ref": "#/$defs/TransactionTemplate" }, { "type": "null" } ], "default": null } }, "required": [ "extractor" ], "title": "InputConfigDetails", "type": "object" }, "MetadataItemTemplate": { "description": "A metadata list item template.\n\n```yaml\ntxn:\n metadata:\n - name: \"import-id\"\n value: \"123456\"\n - name: \"import-src\"\n value: \"plaid\"\n```", "properties": { "name": { "title": "Name", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "integer" }, { "type": "null" } ], "title": "Value" } }, "required": [ "name", "value" ], "title": "MetadataItemTemplate", "type": "object" }, "OutputConfig": { "properties": { "match": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrRegexMatch" } ], "title": "Match" } }, "required": [ "match" ], "title": "OutputConfig", "type": "object" }, "PostingTemplate": { "description": "A posting transform template.\n\nUsed to transform the raw transaction into a beancount posting.\n\n```yaml\ntxn:\n postings:\n - account: \"Expenses:Simple\"\n amount:\n number: \"{{ amount }}\"\n currency: \"USD\"\n```", "properties": { "account": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account" }, "amount": { "anyOf": [ { "$ref": "#/$defs/AmountTemplate" }, { "type": "null" } ], "default": null }, "price": { "anyOf": [ { "$ref": "#/$defs/AmountTemplate" }, { "type": "null" } ], "default": null }, "cost": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cost" } }, "title": "PostingTemplate", "type": "object" }, "SimpleTxnMatchRule": { "description": "The raw transactions extracted by the extractor come with many attributes. Here we list only a few from it:\n\nThe `match` object should be a dictionary.\n\nThe key is the transaction attribute to match, and the value is the regular expression of the target pattern to match.\n\nAll listed attributes need to match so that a transaction will considered matched.\n\nOnly simple matching logic is possible with the current approach.\n\nWe will extend the matching rule to support more complex matching logic in the future, such as NOT, AND, OR operators.", "properties": { "extractor": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Extractor" }, "file": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "File" }, "date": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Date" }, "post_date": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Post Date" }, "timezone": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Timezone" }, "desc": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Desc" }, "bank_desc": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Bank Desc" }, "currency": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Currency" }, "category": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Category" }, "subcategory": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Subcategory" }, "status": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Status" }, "type": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Type" }, "source_account": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Source Account" }, "dest_account": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Dest Account" }, "note": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Note" }, "reference": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Reference" }, "payee": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Payee" }, "gl_code": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Gl Code" }, "name_on_card": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Name On Card" }, "last_four_digits": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Last Four Digits" }, "transaction_id": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/StrPrefixMatch" }, { "$ref": "#/$defs/StrSuffixMatch" }, { "$ref": "#/$defs/StrExactMatch" }, { "$ref": "#/$defs/StrContainsMatch" }, { "$ref": "#/$defs/StrOneOfMatch" }, { "$ref": "#/$defs/StrRegexMatch" }, { "$ref": "#/$defs/DateAfterMatch" }, { "$ref": "#/$defs/DateBeforeMatch" }, { "$ref": "#/$defs/DateSameDayMatch" }, { "$ref": "#/$defs/DateSameMonthMatch" }, { "$ref": "#/$defs/DateSameYearMatch" }, { "type": "null" } ], "default": null, "title": "Transaction Id" } }, "title": "SimpleTxnMatchRule", "type": "object" }, "StrContainsMatch": { "description": "To match values containing a string, one can do this:\n\n```YAML\nimports:\n- match:\n desc:\n contains: \"DoorDash\"\n```", "properties": { "contains": { "title": "Contains", "type": "string" } }, "required": [ "contains" ], "title": "StrContainsMatch", "type": "object" }, "StrExactMatch": { "description": "To match an exact value, one can do this:\n\n```YAML\nimports:\n- match:\n desc:\n equals: \"DoorDash\"\n```", "properties": { "equals": { "title": "Equals", "type": "string" } }, "required": [ "equals" ], "title": "StrExactMatch", "type": "object" }, "StrOneOfMatch": { "description": "To match values belonging to a list of values, one can do this:\n\n```YAML\nimports:\n- match:\n desc:\n one_of:\n - DoorDash\n - UberEats\n - Postmate\n```", "properties": { "one_of": { "items": { "type": "string" }, "title": "One Of", "type": "array" } }, "required": [ "one_of" ], "title": "StrOneOfMatch", "type": "object" }, "StrPrefixMatch": { "description": "To match values with a prefix, one can do this:\n\n```YAML\nimports:\n- match:\n desc:\n prefix: \"DoorDash\"\n```", "properties": { "prefix": { "title": "Prefix", "type": "string" } }, "required": [ "prefix" ], "title": "StrPrefixMatch", "type": "object" }, "StrRegexMatch": { "description": "When a simple string value is provided, regular expression matching will be used. Here's an example:\n\n```YAML\nimports:\n- match:\n desc: \"^DoorDash (.+)\"\n```\nor\n```YAML\nimports:\n- match:\n desc:\n regex: \"^DoorDash (.+)\"\n```", "properties": { "regex": { "title": "Regex", "type": "string" } }, "required": [ "regex" ], "title": "StrRegexMatch", "type": "object" }, "StrSuffixMatch": { "description": "To match values with a suffix, one can do this:\n\n```YAML\nimports:\n- match:\n desc:\n suffix: \"DoorDash\"\n```", "properties": { "suffix": { "title": "Suffix", "type": "string" } }, "required": [ "suffix" ], "title": "StrSuffixMatch", "type": "object" }, "TransactionTemplate": { "description": "A transaction transform template.\n\nUsed to transform the raw transaction into a beancount transaction.\n\n\n```yaml\ntxn:\n date: \"2021-01-01\"\n flag: \"*\"\n narration: \"Simple Transaction\"\n metadata:\n - name: \"icon\"\n value: \"\ud83c\udf54\"\n postings:\n - account: \"Expenses:Simple\"\n amount:\n number: \"{{ amount }}\"\n currency: \"USD\"\n```\n\nresults in the following beancount transaction:\n\n```ledger\n2021-01-01 * \"Simple Transaction\"\n icon: \ud83c\udf54\n Expenses:Simple 100 USD\n```", "properties": { "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "date": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "flag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Flag" }, "narration": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Narration" }, "payee": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Payee" }, "tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tags" }, "links": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Links" }, "metadata": { "anyOf": [ { "items": { "$ref": "#/$defs/MetadataItemTemplate" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Metadata" }, "postings": { "anyOf": [ { "items": { "$ref": "#/$defs/PostingTemplate" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Postings" } }, "title": "TransactionTemplate", "type": "object" }, "TxnMatchVars": { "description": "From time to time, you may find yourself writing similar import-matching rules with\nsimilar transaction templates.\nTo avoid repeating yourself, you can also write multiple match conditions with their\ncorresponding variables to be used by the template in the same import statement.\nFor example, you can simply do the following two import statements:\n\n```yaml\nimports:\n- name: PG&E Gas\n match:\n extractor:\n equals: \"plaid\"\n desc:\n prefix: \"PGANDE WEB ONLINE \"\n actions:\n - txn:\n payee: \"{{ payee }}\"\n narration: \"Paid American Express Blue Cash Everyday\"\n postings:\n - account: \"Expenses:Util:Gas:PGE\"\n amount:\n number: \"{{ -amount }}\"\n currency: \"{{ currency | default('USD', true) }}\"\n\n- name: Comcast\n match:\n extractor:\n equals: \"plaid\"\n desc: \"Comcast\"\n actions:\n - txn:\n payee: \"{{ payee }}\"\n narration: \"Comcast\"\n postings:\n - account: \"Expenses:Util:Internet:Comcast\"\n amount:\n number: \"{{ -amount }}\"\n currency: \"{{ currency | default('USD', true) }}\"\n```\n\nWith match and variables, you can write:\n\n```yaml\nimports:\n- name: Household expenses\n common_cond:\n extractor:\n equals: \"plaid\"\n match:\n - cond:\n desc:\n prefix: \"PGANDE WEB ONLINE \"\n vars:\n account: \"Expenses:Util:Gas:PGE\"\n narration: \"Paid American Express Blue Cash Everyday\"\n - cond:\n desc: \"Comcast\"\n vars:\n account: \"Expenses:Housing:Util:Internet:Comcast\"\n narration: \"Comcast\"\n actions:\n - txn:\n payee: \"{{ payee }}\"\n narration: \"{{ narration }}\"\n postings:\n - account: \"{{ account } \"\n amount:\n number: \"{{ -amount }}\"\n currency: \"{{ currency | default('USD', true) }}\"\n```\n\nThe `common_cond` is the condition to meet for all the matches. Instead of a map, you define\nthe match with the `cond` field and the corresponding variables with the `vars` field.\nPlease note that the `vars` can also be the Jinja2 template and will rendered before\nfeeding into the transaction template.\nIf there are any original variables from the transaction with the same name defined in\nthe `vars` field, the variables from the `vars` field always override.", "properties": { "cond": { "$ref": "#/$defs/SimpleTxnMatchRule" }, "vars": { "anyOf": [ { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "null" } ] }, "type": "object" }, { "type": "null" } ], "default": null, "title": "Vars" } }, "required": [ "cond" ], "title": "TxnMatchVars", "type": "object" } }, "description": "The import configuration file for beancount-importer-rules.\n\nExamples\n\n```yaml title=\"import-config.yml\", hl_lines=\"4 7 11\"\n# yaml-language-server: $schema=https://raw.githubusercontent.com/zenobi-us/beancount-importer-rules/master/schema.json\n\ninputs:\n- match: \"sources/*.csv\" # (1)\n config:\n extractor:\n import_path: \"extractors.my_extractor:YourExtractorClass\" # (2)\n as_name: \"custom name for this extractor instance\"\n date_format: \"%Y-%m-%d\"\n datetime_format: \"%Y-%m-%d %H:%M:%S\"\n default_file: \"books/{{ date.year }}.bean\" # (3)\n prepend_postings:\n - account: \"Assets:Bank\"\n\nimports:\n- name: \"simple\"\n match:\n desc: \"Simple Transaction\"\n actions:\n - type: \"add_txn\"\n txn:\n date: \"2021-01-01\"\n flag: \"*\"\n narration: \"Simple Transaction\"\n postings:\n - account: \"Expenses:Simple\"\n amount:\n number: \"{{ amount }}\"\n currency: \"USD\"\n```\n\n1. pathname is relative to the workspace root\n2. import path is relative to the workspace root\n3. pathname is relative to the workspace root\n\n\nYou can view the [schema](https://raw.githubusercontent.com/zenobi-us/beancount-importer-rules/master/schema.json) for more details\nor refer to the [ImportDoc][beancount_importer_rules.data_types.ImportDoc] api", "properties": { "context": { "anyOf": [ { "type": "object" }, { "type": "null" } ], "default": null, "title": "Context" }, "inputs": { "items": { "$ref": "#/$defs/InputConfig" }, "title": "Inputs", "type": "array" }, "imports": { "$ref": "#/$defs/ImportList" }, "outputs": { "anyOf": [ { "items": { "$ref": "#/$defs/OutputConfig" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Outputs" } }, "required": [ "inputs", "imports" ], "title": "ImportDoc", "type": "object" }