Skip to main content

A tool for reading and transforming PDZ 24 and PDZ 25 formats

Project description

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.
  • 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', verbose=True, debug=True)

#### 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')

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! 😊

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

pdz_tool-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

pdz_tool-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pdz_tool-0.1.0.tar.gz.

File metadata

  • Download URL: pdz_tool-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.1 Linux/6.5.0-28-generic

File hashes

Hashes for pdz_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c981653545c5141986b0156b8e4beab20df7bfa249c5432d73efcc186464c87
MD5 8cae9a80cca160260baf25178da3e45f
BLAKE2b-256 5270e188bcfc130068aaf38756ce2c8735d25aafce6a75e710c36cc643189966

See more details on using hashes here.

File details

Details for the file pdz_tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdz_tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.1 Linux/6.5.0-28-generic

File hashes

Hashes for pdz_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faff89a761b81cce907ee9a3a10dd50cf7854b6c0b91e7b73f9a673fe85cf1f8
MD5 fe2086ef157f676115901469b80b2fe5
BLAKE2b-256 4c61ad4da6167e5f4360991f3cfcf0719c7bebb8e535879586979d38d575ca21

See more details on using hashes here.

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