As Dan said, this is not possible with the beancount v2 data model. It is however possible with
autobean.refactor, which is not integrated with `beancount.ingest` or `beangulp` but is ready to use if all you are looking for is a way to structurally constructing beancount files and programmatically serializing them into text. Example:
```
import io
from autobean_refactor import models, printer
total_price = models.TotalPrice.from_value(decimal.Decimal(100), 'USD')
posting = models.Posting.from_value('Assets:Foo', decimal.Decimal(75), 'GBP', price=total_price)
txn = models.Transaction.from_value(datetime.date(2000, 1, 1), payee=None, narration=None, postings=[posting])
file = models.File.from_value([txn])
text = printer.print_model(file, io.StringIO()).getvalue()
```
I still haven't got around with the documentation so feel free to ping me for any questions.