title: How to do a PUT and Copy INTO Snowflake with Python
body: <p>I am needing to know how to execute a PUT file and COPY INTO from Python.  I know write_pandas will write data into Snowflake directly, and does a PUT and COPY INTO behind the scenes, but how would I accomplish this myself &quot;manually&quot; in Python?</p>
  <p>Just looking for a good example that stages files and copies them into an existing VARIANT column for the XML data.  When I tried write_pandas it inserted quotation marks around each row which screws up the casting of columns in Select statements later in Snowflake.  To get rid of the quotation marks I tried adding quote_identifiers=False but it still writes the data in wrapped in quotes:</p>
  <pre><code>pandasDF = pd.DataFrame(rowData)
  pandasDF.columns =['DATACOLUMN']
  
  from snowflake.connector.pandas_tools import write_pandas
  
  success, nchunks, nrows, _ = write_pandas(engine, pandasDF, 'OI_PNET_GET_PERFORMX_UPL2', quote_identifiers=False)
  </code></pre>
  <p>Here is what it looks like after insertion with starting and trailing quotes:  <a href="https://i.stack.imgur.com/YXU5G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YXU5G.png" alt="enter image description here" /></a></p>
  <p>Thanks.</p>