> For the complete documentation index, see [llms.txt](https://docs.buzzy.buzz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.buzzy.buzz/developing-and-extending-buzzy/buzzy-rest-api/python-access-datatable.md).

# Python Access Datatable

The Python programming language is often used in data science applications. This short example illustrates how to query a Buzzy Datatable from Python.

This example uses two Python libraries [requests](https://www.w3schools.com/python/module_requests.asp) and [json](https://docs.python.org/3/library/json.html).

The flow of the code follows the [microappdata tutorial](/developing-and-extending-buzzy/buzzy-rest-api/datatabledata-tutorial.md):

* login into buzzy with your credentials
* query all of the microApp rows and print them

```
import requests
import json

credentials = { 
    "email":"my-email@buzzy.buzz",
	"password":"my-password"
}

loginResponse = requests.post("https://a.buzzy.buzz/api/login",data=credentials)
print('Log into Buzzy Server Status',loginResponse.status_code)

if (loginResponse.status_code == 200): 
    print('Log into Buzzy Server Response\n',loginResponse.text)
    rtext = json.loads(loginResponse.text)
    rdata = rtext["data"]
    authToken = rdata["authToken"]
    userId = rdata["userId"]
    print('authToken:', authToken)
    print('userId:', userId)

    headers = {'X-Auth-Token': authToken, 'X-User-Id' : userId }
    mID = {"microAppID" : "insert microapp id here"}

    appResponse = requests.post("https://a.buzzy.buzz/api/microappdata",headers=headers,data=mID)
    rtext = json.loads(appResponse.text)
    body = rtext["body"]
    microAppRows = body["microAppRows"]

    for row in microAppRows:
        print(row)

print("Done.")

```

***
