-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_entries.py
39 lines (33 loc) · 1.11 KB
/
list_entries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pykeepass import PyKeePass
kp4_pass = "pass"
kp4 = PyKeePass("keepass_v4_test.kdbx", password=kp4_pass)
kp3_pass = "pass"
kp3 = PyKeePass("keepass_v4_test.kdbx", password=kp3_pass)
kp = kp4
divider = "#" * 50
print("list all groups:")
print(kp.groups)
print(divider)
print("for each group, list all entries:")
for group in kp.groups:
print(group, " entries:")
print(group.entries)
print()
print(divider)
print("for each entry in each group, list entry details:")
for group in kp.groups:
print(group, " entries:")
for entry in group.entries:
print(entry, " details:")
print(" TITLE: ", entry.title)
print(" USERNAME: ", entry.username)
print(" PASSWORD: ", entry.password)
print(" URL: ", entry.url)
print(" NOTES: ", entry.notes)
print(" LAST MODIFIED: ", entry.mtime)
# print(" TAGS: ", entry.tags) # not availalbe for test with KeePasXC
print(" CUSTOM PROPERTIES:")
for prop_key, prop_value in entry.custom_properties.items():
print(" " + prop_key + ": " + prop_value)
print()
print(divider)