Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2012 20:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
parse phpchain xml export to csv format for import by keepass 2
#!/usr/bin/env python
# -*- coding:utf-8 -*-
''' - parse phpchain XML export to CSV'''
import xml.etree.ElementTree as ET
import sys
def parse(file):
tree = ET.parse(file)
root = tree.getroot()
pws = root.findall('pwentry')
for pw in pws:
fields = ['username','url','password','title']
outfields = []
for field in fields:
key = pw.find(field)
if key is not None:
print '|'.join(outfields)
def main(filename):
if __name__ == '__main__':
Copy link

Hi! How did you export an XML from Phpchain ?

Copy link

jamespo commented Jun 28, 2023

It's available in the GUI, I can't remember where as it's > 10 years since I used phpChain.

Copy link

Ok... can't see anything in the GUI. Pretty much no buttons or settings really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment