pythonkeepass

Getting the UUID of an entries list of a group using pykeepass


I'm looking to get the UUID of the entries of a group with pykeepass.

#!/usr/bin/env python3

from pykeepass import PyKeePass

kp = PyKeePass('dbtest.kdbx', password='password')
kpGroup = kp.find_groups(name='GroupTest', first=True)
print(kpGroup.entries)

The code will return this :

[Entry: "GroupTest/test (test@test.com)", Entry: "GroupTest/test (test@test.com)"]

The problem is when 2 entries of the group have a similar Title (test) and username (test@test.com), I am unable to use kp.find_entries() on either the Title or Username, having the uuid displayed by kpGroup.entries for each of those entries will solve the problem.

I would like to have something like this displayed :

[Entry: "GroupTest/test (test@test.com) UUID=uuid", Entry: "GroupTest/test (test@test.com) UUID=uuid"]

Solution

  • It is the difference between

    So you may obtain arbitrary other info from this list of group entries. You wanted this:

    [(e.group, e.title, e.uuid) for e in kpGroup.entries]
    

    You will obtain something as this:

    [(Group: "GroupTest", 'test', UUID('dfc7622c-1cc1-f045-84fd-6e6acab78539')),
     (Group: "GroupTest", 'test', UUID('d14a2296-703e-2a40-aa78-f559f6ec090f'))]