0

I'm using pykeepass to do bulk modification on several hundred keepass files and I'd like to add some additional attributes to the keepass entries.

I tried to do it like this:

def updateRecord(record, recordParent, recordGrandparent, recordGreatGrandparent, kdbxHandle):
   record.custom_properties["keepass2"] = recordGrandparent
   record.custom_properties["keepass3"] = recordGreatGrandparent
   kdbxHandle.save()
   return record

but this has zero effect (no error message no nothing). From my understanding record.custom_properties is a dict which I should be able to modify.

What do I have to do, to add additional attributes to a keepass file with pykeepass?

Thank you!

pinas
  • 2,708
  • 4
  • 21
  • 33

1 Answers1

0

Ok I can answer my own question - setting a custom property is done like this:

record.set_custom_property("keepass2", recordGrandparent)

bigbounty
  • 16,526
  • 5
  • 37
  • 65
pinas
  • 2,708
  • 4
  • 21
  • 33