# Microsoft Fabric in Python

Send data to Fabric, read it back, send and receive events, and read the results of notebooks and pipelines, all from Python services.

## Get started

Start here if this is your first Fabric connection - create it and read rows from a lakehouse table in a service.

[Tutorial](https://zato.io/docs/dev/examples/cloud/fabric/tutorial.html)

service.py

```
# Write rows to a lakehouse table ..
conn = self.microsoft.fabric['Zato Fabric']
conn.write_table(workspace_id, lakehouse_id,
    'events', rows, mode='Append')

# .. and query them with SQL.
rows = conn.query(workspace_id, lakehouse_id,
    'select event_id, status from events')

rows[0]['event_id']
'EVT-1041'
```

[Tutorial Create the connection and read rows from a lakehouse table in a Python service.](https://zato.io/docs/dev/examples/cloud/fabric/tutorial.html) [Writing to Fabric Append new rows, replace small tables whole, load files that are already in the lakehouse and write files to it.](https://zato.io/docs/dev/examples/cloud/fabric/writing-data.html) [Reading from Fabric Pass values into queries and read totals for reports.](https://zato.io/docs/dev/examples/cloud/fabric/reading-data.html) [Events Send events to an eventstream, run a service for each event Fabric raises and read recent events from an eventhouse.](https://zato.io/docs/dev/examples/cloud/fabric/events.html) [Notebooks and pipelines Run a notebook and read what it wrote, run a pipeline and refresh a report, and let Fabric read your own systems.](https://zato.io/docs/dev/examples/cloud/fabric/notebooks-and-pipelines.html)

## API reference

[Tables write\_table, load\_table, list\_tables and wait\_for\_operation, with every parameter.](https://zato.io/docs/dev/examples/cloud/fabric/api/tables.html) [Queries query and refresh\_sql\_endpoint on the SQL analytics endpoint, query\_events on an eventhouse, run\_spark, open\_spark\_session and close\_spark\_session on Spark.](https://zato.io/docs/dev/examples/cloud/fabric/api/queries.html) [Events The Kafka and REST connections for an eventstream endpoint, every field of each.](https://zato.io/docs/dev/examples/cloud/fabric/api/events.html) [Files onelake\_list, onelake\_read, onelake\_write and onelake\_delete, and the two forms a file path takes.](https://zato.io/docs/dev/examples/cloud/fabric/api/files.html) [Jobs run\_job, wait\_for\_job, get\_job and cancel\_job, the job types for notebooks, pipelines and report refreshes, and the statuses.](https://zato.io/docs/dev/examples/cloud/fabric/api/jobs.html) [Connection The Dashboard fields, how tokens are obtained and refreshed, invoke for endpoints without a method of their own, and ping.](https://zato.io/docs/dev/examples/cloud/fabric/api/connection.html) [Workspaces list\_workspaces, get\_workspace, list\_items and get\_item, plus shortcuts and capacities.](https://zato.io/docs/dev/examples/cloud/fabric/api/workspaces.html)
