Unfortunately not, most of the code is basing source data from the talent frame being open itself. So, whether or not there is a way to access that level of information without the frame being available I don't know.
This file mentions the Trait stuff in case you hadn't tracked it down yet :
https://github.com/Gethe/wow-ui-sour...TalentUtil.lua