#NEWLINE# def save_credentials( self , profile = 'default' ) : #NEWLINE# #INDENT# '\n        Save your database credentials so you don\'t have to save them in script.\n\n        Parameters\n        ----------\n        profile: str\n            (optional) identifier/name for your database (i.e. "dw", "prod")\n\n        from db import DB\n        import pymysql\n        db = DB(username="hank", password="foo", hostname="prod.mardukas.com", dbname="bar", dbtype="mysql")\n        db.save_credentials(profile="production")\n        db = DB(username="hank", password="foo", hostname="staging.mardukas.com", dbname="bar", dbtype="mysql")\n        db.save_credentials(profile="staging")\n        db = DB(profile="staging")\n        \n        >>> from db import DemoDB\n        >>> db = DemoDB()\n        >>> db.save_credentials(profile=\'test\')\n        ' #NEWLINE# f = profile_path ( DBPY_PROFILE_ID , profile ) #NEWLINE# dump_to_json ( f , self . credentials )