Utility for converting CSV to Parquet files
Project description
cdef-utils
cdef-utils is a Python package designed to convert CSV and Parquet files to a standardized Parquet format, specifically tailored for processing register data. It provides utilities for batch processing files, generating summaries, and handling various encoding issues.
Features
- Convert CSV and Parquet files to a standardized Parquet format
- Automatic encoding detection for CSV files
- Batch processing of multiple files
- Generation of summary reports
- Progress tracking and resumable processing
- Rich console output with logging
Installation
To install cdef-utils, you can use pip:
pip install cdef-utils
Usage
You can use cdef-utils as a command-line tool:
python -m cdef_utils /path/to/input/directory --summary_file output_summary.json
Arguments
input_directory
: Path to the directory containing CSV and Parquet files to process--summary_file
: (Optional) Path to save the summary JSON file (default: "register_summary.json")
Output
The script will:
- Convert all CSV and Parquet files in the input directory to Parquet format
- Save the converted files in a structured directory format under
/path/to/your/fixed/output/directory/registers
- Generate a summary JSON file with details about each processed register
- Display a summary table in the console
- Log processing details and any errors
Requirements
- Python 3.7+
- polars
- rich
Configuration
- The
OUTPUT_DIRECTORY
is set to/path/to/your/fixed/output/directory
in the script. Modify this path as needed. - Logging is configured to save logs in a
logs
directory in the current working directory.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cdef_utils-1.1.0.tar.gz
.
File metadata
- Download URL: cdef_utils-1.1.0.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 343abc1c24d92fff803d791722c1677ce9386a0867a1f429533ef8defe34d126 |
|
MD5 | 62bd6ea3a7e2bc8a81e77e08bad0c824 |
|
BLAKE2b-256 | 9c8cd73696980cdc1e5057069c87f0ac55be537edbeeb8e89877e22a26a3b54f |
File details
Details for the file cdef_utils-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: cdef_utils-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa1bf0ca6491dda4eed23783895482e3d751e079a48798748bbb500a2ce29abb |
|
MD5 | 2c34d19224677014f8412ecab1b8e7fc |
|
BLAKE2b-256 | 1a8216c4d9af98918d3c2270b65ad50cad36b4336e58f4b204494ba43abfd3f3 |