code: def csvpatch_cmd(input_csv, input=None, output=None, strict=True):
      
      patch_stream = (sys.stdin
                      if input is None
                      else open(input))
      tocsv_stream = (sys.stdout
                      if output is None
                      else open(output, 'w'))
      fromcsv_stream = open(input_csv)
  
      try:
          patch_file(patch_stream, fromcsv_stream, tocsv_stream, strict=strict)
  
      except patch.InvalidPatchError as e:
          error.abort('reading patch, {0}'.format(e.args[0]))
  
      finally:
          patch_stream.close()
          fromcsv_stream.close()
          tocsv_stream.close()
docs: Apply the changes from a csvdiff patch to an existing CSV file.