Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jch
Employee
Employee

read DataModelSchema.json into Python

I downloaded a .pbix file and remamed it to .pbit so I could extract DataModelSchema.json.

 

Has anyone else had luck reading this .json into a python pandas dataframe? In this example, I changed the file name from DataModelSchema.json to datamodelschemasampledl.json

 

Is there a certain encoding I should use with the .json from Power Bi? Thanks in advance for any suggestions

 

This code:

 

import json
with open("C:\datamodelschemasampledl.json", "r") as f:
schema_data = json.load(f)

 

 

 

gives me the error:

 

JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

 

 

 

2 REPLIES 2
Anonymous
Not applicable

I'm having this same issue. Did you ever figure this out?

v-shex-msft
Community Support
Community Support

HI @jch,

The 'DataModelSchema' file should be stored in the pbix file but you cannot directly extract it from pbix file. For this scenario, you can try to import some libraries about compression to analyze the file (pbix file can be recognized with compression software), then you can looping from the recognize folder/path to find out the corresponding contents. (notice: these operations may not directly execute in power bi desktop when you open the report, they may face the read/write protected/permission issues)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.