Skip to main content

PDZ-Tool

PDZ-Tool is a Python library for reading PDZ files and converting them into CSV or JSON formats. PDZ files are commonly used to store data from X-ray fluorescence (XRF) instruments, and this tool allows easy extraction and transformation of the data for analysis.

🚀 Features

  • Read PDZ files in version 24 and 25 formats.
  • Parse and extract important information from the PDZ file into JSON format.
  • Convert the parsed data to CSV format for further analysis.
  • Save the parsed data to a JSON file.
  • CLI tool for parsing and converting PDZ files.
  • Demo script to help you get started.
  • Verbose and debug modes to help troubleshoot issues during parsing.

📥 Installation

You can install pdz-tool via pip.

pip install pdz-tool

📖 Usage

#### 1. Importing and Initializing PDZTool
from pdz_tool import PDZTool

# Initialize a PDZTool object
pdz_tool = PDZTool('path/to/pdz_file.pdz')

#### 2. Parsing a PDZ File
parsed_data = pdz_tool.parse()

#### 3. Accessing Parsed Data as a Dictionary
record_names = pdz_tool.record_names  # Record names found on the pdz file
for record_name in record_names:
    print(f"Record Name: {record_name}")
    print(parsed_data[record_name])
    
#### 4. Converting Parsed Data to JSON
json_data = pdz_tool.to_json()
print(json_data)

#### 5. Saving Parsed Data to JSON File
pdz_tool.to_json('output.json')

#### 6. Saving Parsed Data to CSV
pdz_tool.to_csv('output.csv')

💻 CLI Usage:

pdz-tool path/to/pdz_file.pdz

see pdz-tool --help for more options.

🎓 Demo

Demo folder is included in the project, containing example PDZ files to help you get started. You can run the demo script to test the functionality of the PDZ-Tool:

python demo/demo_script.py

⚙️ Development

Cloning the Repository

If you wish to modify or extend the tool, clone the repository:

git clone git@github.com:bducraux/pdz-tool.git
cd pdz-tool

📦 Dependencies

Installing Poetry

This project uses Poetry for dependency management. If you don't have Poetry installed, you can install it by running:

pip install poetry

Installing Dependencies

To install the dependencies, run:

poetry install

🤝 Contributing

Contributions are welcome! If you find any bugs or have suggestions for new features, feel free to open an issue or submit a pull request.

📜 License

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

📧 Contact

For any inquiries or support, please reach out at bruno.drx@gmail.com.

Thank you for using PDZ-Tool! 🎉😊

Metadata

Release files for pdz-tool 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdz-tool 0.2.5
File Size Uploaded Provenance Actions
pdz_tool-0.2.5.tar.gz 19.1 kB Without provenance Details for pdz_tool-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdz-tool 0.2.5
File Interpreter ABI Platform Actions
pdz_tool-0.2.5-py3-none-any.whl Python 3 none any Details for pdz_tool-0.2.5-py3-none-any.whl

Total release size: 42.1 kB

Release files / pdz_tool-0.2.5.tar.gz

Download URL pdz_tool-0.2.5.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c01d13d9ee7c4a105a707c09f96e5256a5cd5e7e539748bc4dce9c81e3f19603
BLAKE2b-256 checksum
How to use checksums
736011b773ac084c44d06267b505cc4b262bd50984d6396abc1d92693a3ff903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Linux/6.14.0-29-generic

Release files / pdz_tool-0.2.5-py3-none-any.whl

Download URL pdz_tool-0.2.5-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed4141f6eb3bdf9e0244b76699024c8b049890a65cf151b453274062834d57d5
BLAKE2b-256 checksum
How to use checksums
01d9a7c318c0bee6828c08e6eb6b67ab4ef123aab98a46be61f80422cc80d02b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Linux/6.14.0-29-generic

Security for pdz-tool 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page