PyTweepML - A Python Library for TweepML.

TweeML is an XML-based format to represent (hierarchical) groups of Twitter users. See for more information.

Installation: python install


from tweepml import parse_str, parse_filename tml = parse_str(xml) # xml is a TweepML document as a string tml = parse_filename(xml_file) # xml_file is the name of a TweepML document

# you can iterate over the TweepML object to get all TweepLists and Tweeps for item in tml:

if isinstance(item, TweepList):
# this is a sub list - you can iterate on this further print item.title print item.tags
elif isinstance(item, Tweep):
# single twitter entity - this is all possible information: print item.screen_name print print item.title print item.tags

# modify the TweepmL object in place and when you're done, get back TweepmL xml_str = tml.serialize()

# or directly to a file tml.serialize_to_file(tweepml_filename)