Skip to content

Instantly share code, notes, and snippets.

@xiaoruoruo
xiaoruoruo / b2j.py
Last active December 28, 2024 16:14
Convert beancount journal to a JSON format
#!/usr/bin/env python3
from beancount import loader
from beancount.core.amount import Amount
from beancount.core.number import Decimal
from datetime import date
import json
import sys
def json_serial(obj):
if isinstance(obj, date):