Skip to main content

Smudge and Clean filters for Power BI-generated JSON files.

Project description

PBI-PBIP Filters

Python 3.12 License: MIT Ruff pre-commit

PBI-PBIP Filters is a Python package designed to process Power BI-generated JSON files for enhanced human-readability and seamless version control integration. The package provides two key executables:

  1. json-clean: Converts nested and complex Power BI-generated JSON files into a human-readable format.

  2. json-smudge: Reverses the cleaning process, restoring the JSON files to a format that Power BI can properly load.

Features

  • Human-readable JSON: The json-clean utility de-nests JSON objects and JSON strings for easier understanding and editing.

  • Restoration for Power BI: The json-smudge utility ensures that files cleaned by json-clean can be reloaded into Power BI.

  • Command-line utilities: Both json-clean and json-smudge can be used directly from the command line for seamless file processing.

Installation

You can install the package using pip:

pip install pbi-pbip-filters

Usage

Cleaning a JSON File

To clean a Power BI-generated JSON file for readability, run the following command:

json-clean <file-or-glob> [<file-or-glob2> ... ]

Example:

json-clean report.json my_folder/*.json

Smudging a JSON File

To restore a cleaned JSON file to its original state for Power BI loading, run:

json-smudge <file-or-glob> [<file-or-glob2> ...]

Example:

json-smudge cleaned_report.json cleaned/**/*.json

Dependencies

This package depends solely on Python’s standard libraries. For contributing and testing, pre-commit and pytest may be required.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

If you would like to contribute, feel free to open issues or submit pull requests.

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

pbi_pbip_filters-0.0.1.tar.gz (5.5 MB view hashes)

Uploaded Source

Built Distribution

pbi_pbip_filters-0.0.1-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

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