Menu

#59 How to add a field to an entry?

open
nobody
None
trunk
2014-09-02
2014-08-19
No

Hello,
as recommended, I downloaded the latest version from bzr. I am successfully parsing a bibtex file but I would like to add a field to each entry. However, this returns an error:

from pybtex.database.input import bibtex
bibRefs = bibtex.Parser().parse_file(bibtexFile)
bibRefs.entries["test"]["file"] = []
...
TypeError: 'Entry' object does not support item assignment

How should I do it?
Thanks,
TF

Discussion

  • Anonymous

    Anonymous - 2014-08-30

    Hi,

    should be like this:

    bibRefs.entries["test"].fields["file"] = []
    
     
  • Timothee Flutre

    Timothee Flutre - 2014-09-02

    Perfect, thanks! (I don't know how to close this ticket.)

     
MongoDB Logo MongoDB