# 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`.
```bash
pip install pdz-tool
```
## 📖 Usage
```python
#### 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:
```bash
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:
```bash
python demo/demo_script.py
```
## ⚙️ Development
### Cloning the Repository
If you wish to modify or extend the tool, clone the repository:
```bash
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:
```bash
pip install poetry
```
#### Installing Dependencies
To install the dependencies, run:
```bash
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](mailto:bruno.drx@gmail.com).
Thank you for using PDZ-Tool! 🎉😊
Raw data
{
"_id": null,
"home_page": "https://github.com/bducraux/pdz-tool",
"name": "pdz-tool",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "pdz, format, transformation",
"author": "Bruno Ducraux",
"author_email": "bruno.drx@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2d/e4/91088bef2f20f039805a8c1f234dc284eb6511833c46f638b5af13bc2f34/pdz_tool-0.2.1.tar.gz",
"platform": null,
"description": "# PDZ-Tool\n\n**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.\n\n## \ud83d\ude80 Features\n\n- **Read PDZ files in version 24 and 25 formats.**\n- **Parse and extract important information from the PDZ file into JSON format.**\n- **Convert the parsed data to CSV format for further analysis.**\n- **Save the parsed data to a JSON file.**\n- **CLI tool for parsing and converting PDZ files.**\n- **Demo script to help you get started.**\n- **Verbose and debug modes to help troubleshoot issues during parsing.**\n\n## \ud83d\udce5 Installation\n\nYou can install `pdz-tool` via `pip`.\n\n```bash\npip install pdz-tool\n```\n\n## \ud83d\udcd6 Usage\n\n```python\n#### 1. Importing and Initializing PDZTool\nfrom pdz_tool import PDZTool\n\n# Initialize a PDZTool object\npdz_tool = PDZTool('path/to/pdz_file.pdz')\n\n#### 2. Parsing a PDZ File\nparsed_data = pdz_tool.parse()\n\n#### 3. Accessing Parsed Data as a Dictionary\nrecord_names = pdz_tool.record_names # Record names found on the pdz file\nfor record_name in record_names:\n print(f\"Record Name: {record_name}\")\n print(parsed_data[record_name])\n \n#### 4. Converting Parsed Data to JSON\njson_data = pdz_tool.to_json()\nprint(json_data)\n\n#### 5. Saving Parsed Data to JSON File\npdz_tool.to_json('output.json')\n\n#### 6. Saving Parsed Data to CSV\npdz_tool.to_csv('output.csv')\n```\n\n### \ud83d\udcbb CLI Usage:\n```bash\npdz-tool path/to/pdz_file.pdz\n```\nsee `pdz-tool --help` for more options.\n\n## \ud83c\udf93 Demo\n Demo folder is included in the project, containing example PDZ files to help you get started. \n You can run the demo script to test the functionality of the PDZ-Tool:\n\n```bash\npython demo/demo_script.py\n```\n## \u2699\ufe0f Development\n### Cloning the Repository\nIf you wish to modify or extend the tool, clone the repository:\n \n```bash\ngit clone git@github.com:bducraux/pdz-tool.git\ncd pdz-tool\n``` \n\n### \ud83d\udce6 Dependencies\n#### Installing Poetry\nThis project uses Poetry for dependency management. If you don't have Poetry installed, you can install it by running:\n\n```bash\npip install poetry\n```\n#### Installing Dependencies\nTo install the dependencies, run:\n\n```bash\npoetry install\n```\n\n## \ud83e\udd1d Contributing\nContributions are welcome! If you find any bugs or have suggestions for new features, feel free to open an issue or submit a pull request.\n\n## \ud83d\udcdc License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## \ud83d\udce7 Contact\nFor any inquiries or support, please reach out at [bruno.drx@gmail.com](mailto:bruno.drx@gmail.com).\n\nThank you for using PDZ-Tool! \ud83c\udf89\ud83d\ude0a",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for reading and transforming PDZ 24 and PDZ 25 formats",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/bducraux/pdz-tool",
"Repository": "https://github.com/bducraux/pdz-tool"
},
"split_keywords": [
"pdz",
" format",
" transformation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c209bdc59abe74c368b0b746f8c72c93b0fe1c55884e7f81c56b27372948d447",
"md5": "e8e3c367cd34fb0677c7152fd2e34a5a",
"sha256": "c6512cda9b04672c8c5e56f06f468feae93d6e99d1cd962f4a6b0b2f8aa66ea6"
},
"downloads": -1,
"filename": "pdz_tool-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e8e3c367cd34fb0677c7152fd2e34a5a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 15148,
"upload_time": "2024-12-02T23:25:19",
"upload_time_iso_8601": "2024-12-02T23:25:19.463724Z",
"url": "https://files.pythonhosted.org/packages/c2/09/bdc59abe74c368b0b746f8c72c93b0fe1c55884e7f81c56b27372948d447/pdz_tool-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2de491088bef2f20f039805a8c1f234dc284eb6511833c46f638b5af13bc2f34",
"md5": "6e43b2534d41cd3400003fa0a9298ce1",
"sha256": "86bf5f9accc35671672d5d447f476663e4c17dc0e61bc1f2ca00bc2fd8f1ebf5"
},
"downloads": -1,
"filename": "pdz_tool-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "6e43b2534d41cd3400003fa0a9298ce1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 13085,
"upload_time": "2024-12-02T23:25:21",
"upload_time_iso_8601": "2024-12-02T23:25:21.980366Z",
"url": "https://files.pythonhosted.org/packages/2d/e4/91088bef2f20f039805a8c1f234dc284eb6511833c46f638b5af13bc2f34/pdz_tool-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 23:25:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bducraux",
"github_project": "pdz-tool",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pdz-tool"
}