Registry / azure / semantic-link

semantic-link

JSON →
library0.14.1pypypiunverified

Semantic Link, also known by its core Python library SemPy, facilitates seamless collaboration between data scientists and business analysts within Microsoft Fabric. It enables Python and Spark users in Synapse Data Science notebooks to connect directly to Power BI semantic models, access their underlying data, measures, and rich semantic information, eliminating the need to re-implement business logic. The library is actively developed, with version 0.14.0 as of the latest release, and is specifically designed for the Microsoft Fabric environment.

%pip install -U semantic-link
INSTALL
IMPORT
SIG · SEMANTIC-LINK
S
semantic-link
azurepythonv0.14.1
Install
65.3s avg
Import
6295ms
Disk
1434MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 66.9s
py 3.11
✕ build_error
✓ 66.05s
py 3.12
✕ build_error
✓ 64.05s
py 3.13
✕ build_error
✓ 64.08s
py 3.9
✕ build_error
✕ build_error
1434MB installed
● package 1434MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fabric
import sempy.fabric as fabric
Common alias for functions interacting with Fabric items like semantic models and workspaces.
functions
import sempy.functions as sf
Common alias for semantic functions provided by SemPy.

This quickstart demonstrates how to list available semantic models (datasets) in your Microsoft Fabric workspace and then read a specific table from one of those models using the `sempy.fabric` module. This code should be executed within a Microsoft Fabric notebook.

import sempy.fabric as fabric # List all semantic models (datasets) in the current workspace df_datasets = fabric.list_datasets() print("Available datasets:") print(df_datasets.head()) # Assuming a dataset named 'Sales & Returns Sample' exists # Read a specific table from a semantic model df_customers = fabric.read_table(dataset="Sales & Returns Sample", table="Customer") print("\nFirst 5 rows of the 'Customer' table:") print(df_customers.head())
Debug
Known issues
breakingSemantic Link (SemPy) is exclusively supported within Microsoft Fabric notebooks and Spark environments. It will not run in standalone Python environments outside of Fabric. Attempting to use it locally will result in errors related to missing Fabric-specific components.
fix
Ensure all development and execution involving Semantic Link occurs within a Microsoft Fabric workspace. For local testing or development, consider mocking Fabric interactions or adapting code to use alternative libraries.
affects: All versions
gotchaThe `semantic-link` package is a meta-package. For core functionality, `semantic-link-sempy` is sufficient. If you encounter dependency conflicts or only need specific features, consider installing `semantic-link-sempy` and other `semantic-link-functions-*` packages individually instead of the meta-package.
fix
If `pip install semantic-link` causes issues, try `pip install semantic-link-sempy` and then install specific function packages (e.g., `semantic-link-functions-holidays`) as needed.
affects: All versions
gotchaSemantic Link is pre-installed in Microsoft Fabric Runtimes 1.2 (Spark 3.4) and above. Explicitly installing it with `%pip install -U semantic-link` is only necessary for older runtimes (Spark 3.3 or below) or to ensure you have the very latest version.
fix
Check your Fabric Spark runtime version. If it's 3.4 or higher, the library is likely already available. Only run `%pip install -U semantic-link` if you need to upgrade or if you're on an older runtime.
affects: All versions, specifically relevant for older Fabric Runtimes
gotchaUsing Semantic Link requires a Microsoft Fabric subscription with appropriate capacity (e.g., F64 for LLM samples) and Power BI datasets residing in a Premium or Fabric workspace within the same tenant. Certain advanced features may also require XMLA Read/Write enabled for your capacity.
fix
Verify that your Microsoft Fabric environment and Power BI workspace configurations meet the necessary prerequisites outlined in the official documentation.
affects: All versions
gotchaThe `semantic-link-labs` library is an official extension offering early access to experimental features. While powerful, features in `Labs` may be less stable and subject to change or removal compared to the core `semantic-link` library.
fix
Be mindful of the experimental nature of `semantic-link-labs` features. For production-critical workflows, prioritize features available directly in the core `semantic-link` package.
affects: All versions of `semantic-link-labs`
gotchaThe primary goal of Semantic Link is to leverage the semantic information (measures, relationships, data categories) already defined in Power BI semantic models. A common anti-pattern is to extract raw data and re-implement business logic in Python/Spark, negating a key benefit of the library.
fix
Focus on utilizing `sempy` functions to compute Power BI measures, query with DAX, and propagate semantic metadata to ensure consistency and avoid duplicated effort.
affects: All versions
Upgrade
Version history
0.14.1latest on PyPI · released Apr 29, 2026
Audit
Dependencies
pandasrequiredCore data manipulation with FabricDataFrame, which extends pandas DataFrames.
pysparkrequiredFor integration with Apache Spark ecosystems within Microsoft Fabric.
semantic-link-sempyrequiredContains the core semantic link functionality; 'semantic-link' is a meta-package that includes this.
semantic-link-functions-holidaysoptionalProvides semantic functions related to holidays.
semantic-link-functions-geopandasoptionalProvides semantic functions for geospatial data.
Agent activity
46 hits · last 30 days
node
40
OpenAI (training)
1
Resources
semantic-link — pip install semantic-link · libregistry