I want to run Python query in snowflake to access DataScope Warehouse, but I only have DSOS SQLs which Snowflake does support, but I want Python codes to access DSW for my customers.
Could you assist please? Thank you
Hi @Uttam_Haridas ,
Python can be used to retrieve the data from DSS REST API, you can start with checking Overview, Quickstart guide, Documentation, and tutorials of the DSS in LSEG DataScope Select - REST API | Devportal
You may download the Postman collection example in 'Download' tab, then follow this article to Generate code for a REST API call using Postman in just a few clicks | Devportal
@Uttam.Haridas
To run a SQL query in Python snowflake, you may need to use the Snowflake Connector for Python.
I found the following sample code on Google.
import snowflake.connector # Establish connection conn = snowflake.connector.connect( user='your_user', password='your_password', account='your_account', warehouse='your_warehouse', database='your_database', schema='your_schema' ) # Create a cursor object cur = conn.cursor() # Execute a SQL query cur.execute("SELECT * FROM your_table LIMIT 10") # Fetch results for row in cur: print(row) # Close cursor and connection cur.close() conn.close()
However, you need to contact the product team directly via LSEG Support to verify this.