Can I ask a stupid question:

Why are tags a list instead of a dictionary?

Makes it really annoying to parse through. Right now I have to create a for loop to with an if statement since the data is unordered.

Am I missing something?

Reply to this note

Please Login to reply.

Discussion

A dictionary would not allow the same key twice, right? Many events use repeated "keys".

Dang, you’re right! Thanks for clearing that up. So is the best way really to do something like:

for tag in event[1]['tags']:

if tag[0] == 'p':

pubkey_ref = tag[1]

if tag[0] == 'e':

target_eventID = tag[1]

yes, sort of.