[GNC] Python binding and commodity details

David T. sunfish62 at yahoo.com
Sun Apr 26 01:34:11 EDT 2026


Saving a copy as sql is pretty straightforward, which is why I worded my advice the way I did. I'm not at my machine right now, but the sql to get securities with their namespace isn't too complicated. ISTR doing something like this not too long ago. Once I'm back at my machine tomorrow, I can give you an exact sql statement. 

David T. 

On April 26, 2026 8:10:07 AM GMT+05:30, Kalpesh Patel <kalpesh.patel at usa.net> wrote:
>I should add a bit of details: I save file in XML format. So SQL query is not available unless I temporarily save it to SQL and do so from there on. Security Editor does include namespace column but it won’t help in any way for what I am after, which is to extract it programmatically.
>
> 
>
> 
>
>From: David T. <sunfish62 at yahoo.com> 
>Sent: Saturday, April 25, 2026 12:17 PM
>To: gnucash-user at gnucash.org; Kalpesh Patel <kalpesh.patel at usa.net>
>Subject: Re: [GNC] Python binding and commodity details
>
> 
>
>I can't address the exact question, but I imagine with a little digging you could get that info from an sql query on a copy of your data saved in sql. 
>
>Also not exactly your question, but does the security editor list allow you to include the namespace column? And if so, would that help you out?
>
>David T. 
>
> 
>
>On April 25, 2026 6:30:57 PM GMT+05:30, Kalpesh Patel <kalpesh.patel at usa.net <mailto:kalpesh.patel at usa.net> > wrote:
>
>Hi GNC community. 
>
> 
>
>This is more likely a question for devs: is there a way to get a list of all
>commodities and all their attributes (specifically name space) defined for
>each that are in the book by way of Python bindings? 
>
> 
>
>If so, is there an example of such binding code?
>
> 
>
>Thanks.
>
>
>  _____  
>
>gnucash-user mailing list
>gnucash-user at gnucash.org <mailto:gnucash-user at gnucash.org> 
>To update your subscription preferences or to unsubscribe:
>https://lists.gnucash.org/mailman/listinfo/gnucash-user
>
>
>  _____  
>
>Please remember to CC this list on all your replies.
>You can do this by using Reply-To-List or Reply-All.
>
>
>David T.
>


David T.


More information about the gnucash-user mailing list