A small Python utility for loading CSV data from a configured directory, standardizing column names, removing duplicates, checking for missing values, and saving a cleaned CSV output.
- Load CSV files from a directory configured via environment variables.
- Standardize column names to
snake_case. - Remove duplicate rows.
- Report missing values and halt processing if any are found.
- Save cleaned data to
data/processedwith timestamped filenames.
.
├── data/
│ └── raw/
├── src/
│ ├── app.py
│ └── main.py
├── .env
├── requirements.txt
└── README.md
- Python 3.9+
- Dependencies in
requirements.txt
- Create and activate a virtual environment (optional but recommended).
- Install dependencies:
pip install -r requirements.txt- Configure the data directory in
.env:
DIRECTORY=/absolute/path/to/your/raw/dataPlace your CSV files in that directory (or update the path accordingly).
Run the main entrypoint:
python src/main.pyThe program will:
- Load CSV files from the configured
DIRECTORY. - Standardize column names.
- Remove duplicate rows.
- Check for missing values (halts if any are found).
- Save cleaned data to
data/processedwith a timestamped filename.
Cleaned files are saved to:
data/processed/cleaned_data_<timestamp>.csv
- Only
.csvfiles are currently loaded in the implementation, even though.jsonand.xlsxare listed as acceptable extensions. - If no files are found or no valid data is loaded, the script exits with a log message.
See LICENSE.