Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on commodity entries get converted to name #272

Open
alensiljak opened this issue Feb 8, 2025 · 4 comments
Open

Notes on commodity entries get converted to name #272

alensiljak opened this issue Feb 8, 2025 · 4 comments

Comments

@alensiljak
Copy link

alensiljak commented Feb 8, 2025

Hi!

My understanding from the Commodities description is that any metadata can be appended to the commodity declarations.
I have plenty of note attributes, with various descriptions and details.

Notes seem to be translated into name attributes, instead. I think it would be ok to leave them as-is.

In particular, when I have multiple note rows/entries, it makes no sense to call them name. I wonder what happens to them - i.e. are they stored in a dictionary entry or a set, where multiple attributes with the same name are allowed.

I've tried renaming the name: to note: and there are no complaints from bean-check.

@tbm
Copy link
Collaborator

tbm commented Feb 9, 2025

This is something implemented by @zacchiro. @zacchiro do you remember why you did it this way? IIRC, name has some meaning in beancount whereas note does not?

I looked at beancount/beancount/core/data.py (v2) and only see:

Commodity = new_directive('Commodity', [
    ('currency', Currency)])

I don't see anything about name there but maybe it's somewhere else?

@tbm
Copy link
Collaborator

tbm commented Feb 9, 2025

But yeah, at the very least, the l2b docs should explain why we change note to name. The docs say we do this but not why.

@tbm
Copy link
Collaborator

tbm commented Feb 9, 2025

In particular, when I have multiple note rows/entries

Can you show an example? Is that even legal in ledger? I suspect they just override each other and the last one counts.

@alensiljak
Copy link
Author

alensiljak commented Feb 9, 2025

In particular, when I have multiple note rows/entries

Can you show an example? Is that even legal in ledger? I suspect they just override each other and the last one counts.

The note is not really used anywhere that I know, so it does not pose a problem.
I simply have multiple lines with, for example, the full symbol, contact details, the date of merger, full name of the fund, or whatever else.
Having a name for the actual name record is OK. But calling ISIN a name is wrong. Or a website URL, etc.

It is something that could easily be kept in comments, as well, but I'm just trying to work out how to solve this in the best manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants