Metadata-Version: 2.4
Name: pbip-tools
Version: 0.3.0
Summary: Smudge and Clean filters for Power BI-generated JSON files.
Project-URL: Homepage, https://github.com/moshemoshe137/pbip-tools
Project-URL: Repository, https://github.com/moshemoshe137/pbip-tools
Project-URL: Issues, https://github.com/moshemoshe137/pbip-tools/issues
Author-email: Moshe Rubin <mosherubin137@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Moshe Rubin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: File Formats :: JSON
Classifier: Topic :: File Formats :: JSON :: JSON Schema
Classifier: Topic :: Software Development :: Version Control
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# PBIP Tools

[![Python 3.12](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/release/python-312/)
[![License: MIT](https://img.shields.io/github/license/moshemoshe137/pbip-tools)](https://github.com/moshemoshe137/pbip-tools/blob/main/LICENSE)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

**PBIP-tools** 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:

```bash
pip install pbip-tools
```

## Usage

### Cleaning a JSON File

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

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

Example:

```bash
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:

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

Example:

```bash
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](https://github.com/moshemoshe137/pbip-tools/blob/main/LICENSE) file for
details.

## Contributing

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