def save_congress(congress, dest):
try:<EOL><INDENT>logger.debug(congress.name)<EOL>logger.debug(dest)<EOL>congress_dir = make_congress_dir(congress.name, dest)<EOL>congress.legislation.to_csv("<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>logger.debug(congress_dir)<EOL>congress.sponsors.to_csv("<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.cosponsors.to_csv(<EOL>"<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.events.to_csv("<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.committees.to_csv(<EOL>"<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.subjects.to_csv("<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.votes.to_csv("<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>congress.votes_people.to_csv(<EOL>"<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL>if hasattr(congress, '<STR_LIT>'):<EOL><INDENT>congress.amendments.to_csv(<EOL>"<STR_LIT>".format(congress_dir),<EOL>encoding='<STR_LIT:utf-8>')<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>logger.error("<STR_LIT>")<EOL>exc_type, exc_obj, exc_tb = sys.exc_info()<EOL>fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[<NUM_LIT:1>]<EOL>logger.error(exc_type, fname, exc_tb.tb_lineno)<EOL><DEDENT>
Takes a congress object with legislation, sponser, cosponsor, commities
and subjects attributes and saves each item to it's own csv file.