A Python library to parse and process TMDL (Table Metadata Description Language) files.
Project description
TMDLParser
A Python library designed to parse and process TMDL (Table Metadata Description Language) files
Table of Contents
About The Project
TMDLParser is a Python library designed to parse and process TMDL (Table Metadata Description Language) files. It provides a structured way to handle data descriptions, properties, and calculations with an easy-to-use API.
- Parses TMDL files into structured Python objects.
- Handles multiple levels of nested properties.
- Supports detailed descriptions, elements, properties, and calculations.
- Easily integrates with other Python applications.
- Lightweight and easy to install.
Getting Started
Install the library directly from PyPI:
pip install tmdl-parser
Prerequisites
python>=3.10 Library uses only standart library and no 3th party.
Usage
Basic Example
from tmdlparser import TMLDParser
# Initialize the parser with a TMDL file path
parser = TMLDParser("path/to/tmdl/file.tmdl")
# Print the parsed structure
print(parser)
Results:
Description: Table Description
Element: Table Name
Properties:
----------
Description: Column Description
Element: Column Name
Props: ['property_1', 'property_2']
Calcs: ['calculation_1']
Calculation: ['Calculation Formula']
--------------------
Export formats
The parser can also return the parsed structure as a plain Python dictionary
or as a pandas DataFrame for downstream analysis:
from tmdlparser import TMLDParser
parser = TMLDParser("path/to/project.pbip")
parser.parse_all_tables()
# Nested dict, ready for json.dumps() or any downstream processing.
data = parser.to_dict()
# Flat DataFrame (one row per TMDL entry, nested entries get parent_element set).
df = parser.to_dataframe()
# Or keep only the top-level entries with raw properties:
df_top = parser.to_dataframe(flatten=False)
to_dataframe() requires pandas, which is an optional dependency. Install it
with:
pip install tmdl-parser[pandas]
Roadmap
- Publish to pip
- Create tests
- Better return format for parsed files
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt for more information.
Contact
Project Link: https://github.com/Atzingen/tmdl-parser
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tmdl_parser-0.2.0.tar.gz.
File metadata
- Download URL: tmdl_parser-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8867dcc563860671ddf4f578951e5c67a9997c12e9db1f334286c00e2167dd5
|
|
| MD5 |
5fde8b3275290c9abbf18b23c398aab6
|
|
| BLAKE2b-256 |
3c5525a9681eaf5ec3ec4a22c0a310cbe369af9cadbbb503d419054712b71649
|
Provenance
The following attestation bundles were made for tmdl_parser-0.2.0.tar.gz:
Publisher:
publish.yml on Atzingen/tmdl-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tmdl_parser-0.2.0.tar.gz -
Subject digest:
e8867dcc563860671ddf4f578951e5c67a9997c12e9db1f334286c00e2167dd5 - Sigstore transparency entry: 1302103429
- Sigstore integration time:
-
Permalink:
Atzingen/tmdl-parser@ed45cbffc3696aab9d98b08f3a64d035aac0dc4f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Atzingen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed45cbffc3696aab9d98b08f3a64d035aac0dc4f -
Trigger Event:
push
-
Statement type:
File details
Details for the file tmdl_parser-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tmdl_parser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c1e1f2896e79d3048c3469c2cbcb75cdf7b1aae7c473f2caff820b575aa7144
|
|
| MD5 |
7ccc297f1af12418f7a049bab991a349
|
|
| BLAKE2b-256 |
a556f86d0078f35e46bf9a68377a331076d5ca505fe5918321ccbbb4e6a74c7b
|
Provenance
The following attestation bundles were made for tmdl_parser-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Atzingen/tmdl-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tmdl_parser-0.2.0-py3-none-any.whl -
Subject digest:
4c1e1f2896e79d3048c3469c2cbcb75cdf7b1aae7c473f2caff820b575aa7144 - Sigstore transparency entry: 1302103565
- Sigstore integration time:
-
Permalink:
Atzingen/tmdl-parser@ed45cbffc3696aab9d98b08f3a64d035aac0dc4f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Atzingen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed45cbffc3696aab9d98b08f3a64d035aac0dc4f -
Trigger Event:
push
-
Statement type: