Skip to main content

A Python library to parse and process TMDL (Table Metadata Description Language) files.

Project description

Contributors Forks Stargazers Issues MIT License


Logo

TMDLParser

A Python library designed to parse and process TMDL (Table Metadata Description Language) files

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

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.

(back to top)

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).

(back to top)

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/Atzingen/tmdl-parser

gustavo.von.atzingen@gmail.com

(back to top)

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

tmdl_parser-0.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

tmdl_parser-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for tmdl_parser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e8867dcc563860671ddf4f578951e5c67a9997c12e9db1f334286c00e2167dd5
MD5 5fde8b3275290c9abbf18b23c398aab6
BLAKE2b-256 3c5525a9681eaf5ec3ec4a22c0a310cbe369af9cadbbb503d419054712b71649

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmdl_parser-0.2.0.tar.gz:

Publisher: publish.yml on Atzingen/tmdl-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tmdl_parser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c1e1f2896e79d3048c3469c2cbcb75cdf7b1aae7c473f2caff820b575aa7144
MD5 7ccc297f1af12418f7a049bab991a349
BLAKE2b-256 a556f86d0078f35e46bf9a68377a331076d5ca505fe5918321ccbbb4e6a74c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmdl_parser-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Atzingen/tmdl-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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