Getting started…

Now let’s start this tutorial! Our goal is to create a simple Python script that accesses a SharePoint instance. We assume the SharePoint instance already exists (make sure you have your login credentials at hand). These are simple steps you need to follow:

1. Request a free trial and install Connect Bridge

2. Install Python for Windows ver. 3.7+. Please note that to make writing, running & debugging my script easier we have used Liclipse 5.2.4 with the pydev plugin, but this is, of course, optional. You can use the editor of your choice.

3. Install pyodbc module 4.0.26+

4. Run Connect Bridge Management Studio and

4.1. Add an account for SharePoint (Accounts – Add account). This is where you will need those credentials we mentioned earlier.

4.2. Open the New Query option and then the Connection Browser. Find the SharePoint Connector and open until you see the DefaultConnection. Right click on it and choose Get Connection string. Then copy the ODBC connection string. You will need it to pass it on to the script.

4.3. Use the New Query option to test out a query that will access what you need in SharePoint. We will do an example query here, but this is where you should put in what it is that you are looking for in SharePoint. Once you have clicked New Query, open the Connection Browser. Find the SharePoint Connector and open until you see the Tables option. We can see that the schema contains a “table” called Site_Pages so we can construct our query as SELECT UniqueId, ContentType, Created, Modified, ContentVersion FROM Site_Pages LIMIT 10;

to select first 10 entries from the SharePoint’s Site Pages list. It is important to note that although it looks as if we are using a database directly, that is not the case. Connect Bridge is accessing the API and then presenting it as if it was a database. Once you have your query, copy it, as you will also need it to pass it on to the script.