Skip to main content

Unified Python connectivity toolkit for Microsoft Fabric

Project description

PyFabricConnect

Unified Python connectivity toolkit for Microsoft Fabric Warehouses, Lakehouses, and SQL Analytics Endpoints.

PyFabricConnect simplifies secure connectivity to Microsoft Fabric using modern authentication methods and multiple connector backends including JDBC, ODBC, and SQLAlchemy.


Features

  • JDBC connectivity for Spark workloads
  • ODBC connectivity using pyodbc
  • SQLAlchemy integration
  • Service Principal authentication
  • OAuth Access Token authentication
  • Pandas DataFrame support
  • Spark DataFrame support
  • Unified authentication abstraction
  • Enterprise-ready architecture

Supported Technologies

Technology Supported
Microsoft Fabric Warehouse
Lakehouse SQL Endpoint
Spark JDBC
pyodbc
SQLAlchemy
Pandas
PySpark

Installation

Base Installation

pip install pyfabricconnect

Spark Support

Microsoft Fabric environments already include PySpark and an active Spark runtime.

For local Spark environments, install Spark support with:

pip install pyfabricconnect[spark]

Development Environment

pip install pyfabricconnect[dev]

Quick Start

Service Principal Authentication

from pyfabricconnect import FabricClient
from pyfabricconnect.auth import ServicePrincipalAuth

auth = ServicePrincipalAuth(
    tenant_id="YOUR_TENANT_ID",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET"
)

client = FabricClient(
    server="YOUR_SERVER",
    database="WH_PYFABRICCONNECT",
    auth=auth
)

df = client.query_pandas("""
SELECT * FROM dbo.qlbacan
""")

print(df.head())

Spark Example

The query_spark() method requires an active SparkSession.

from pyspark.sql import SparkSession

from pyfabricconnect import FabricClient
from pyfabricconnect.auth import ServicePrincipalAuth

spark = SparkSession.builder.getOrCreate()

auth = ServicePrincipalAuth(
    tenant_id="YOUR_TENANT_ID",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET"
)

client = FabricClient(
    server="YOUR_SERVER",
    database="WH_PYFABRICCONNECT",
    auth=auth,
    spark=spark
)

spark_df = client.query_spark("""
SELECT * FROM dbo.qlbacan
""")

spark_df.show()

SQLAlchemy Example

engine = client.engine()

Supported Environments

PyFabricConnect is designed to work with:

  • Microsoft Fabric Notebooks
  • Azure Synapse Analytics
  • Databricks
  • Local PySpark environments
  • Python applications
  • Data engineering pipelines

Project Structure

pyfabricconnect/
│
├── pyfabricconnect/
│   ├── auth/
│   ├── connectors/
│   ├── core/
│   └── utils/
│
├── tests/
├── examples/
├── README.md
├── LICENSE
├── pyproject.toml
└── .gitignore

Project Status

PyFabricConnect is currently under active development.


Roadmap

v0.1.0

  • JDBC Connector
  • ODBC Connector
  • SQLAlchemy Connector
  • Service Principal Authentication
  • OAuth Token Authentication

Future Releases

  • Managed Identity
  • Token Refresh
  • Retry Policies
  • Structured Logging
  • Async Support
  • Connection Pooling

Contributing

Contributions, issues, and feature requests are welcome.


Support the Project

If PyFabricConnect helps your projects or organization, consider supporting development.

Your support helps maintain:

  • Fabric integrations
  • Authentication improvements
  • New connectors
  • Documentation
  • Community support

Donations


License

Apache License 2.0

Copyright 2026 Eduardo Osorio Venegas - EOSOVNGAS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfabricconnect-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfabricconnect-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file pyfabricconnect-0.1.0.tar.gz.

File metadata

  • Download URL: pyfabricconnect-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pyfabricconnect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 532096251e750e95b7eb67cd2a10308e3286a7cba7f5fb8864c1bbf282588217
MD5 83723cc9b31327b091a37ce82a693b5a
BLAKE2b-256 f3ccfd2406f1c6383cd0b274e0096f8decc1012086713f3b75b2dd539be45c28

See more details on using hashes here.

File details

Details for the file pyfabricconnect-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfabricconnect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f701c9d3d1544e706e445c1bc145cde86cc1a51b3fbbd667a0e81c5c2fa5c78
MD5 ac4015718d3323e081bd8fe977460aa1
BLAKE2b-256 1eccf23674bfee3ba402558632fb59df487e9c528aa49a3177baf7c2ae7a17af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page