Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Custom Text Data Parser

A lightweight, robust Python utility script designed to parse proprietary, text-based data formats into standard Python data structures (lists and dictionaries).

📖 Overview

Often, data is exported from legacy systems or specialized hardware in non-standard plaintext formats that standard parsers (like the csv or json modules) cannot read natively. This utility is engineered to parse text files demarcated by specific keywords (COLUMN and END), safely structuring the parsed text into 2-Dimensional lists and Python dictionary objects for downstream analysis.

✨ Features

  • 2D List Extraction: load_data_from_file_into_2D_list() groups text rows under column headers into nested arrays.
  • Dictionary Extraction: load_data_from_file_into_dictionary() maps column headers as keys and the subsequent rows as lists of values.
  • Robust Iteration: Safely handles file line stripping and state-machine-like parsing based on string prefixes.

🛠️ Technology Stack

  • Language: Python 3.x (Standard Library only; no external dependencies)

📂 Project Structure

python-data-parser/
├── src/
│   └── parser.py        # Core utility functions
├── screenshot.png       # Execution output demonstration
└── README.md

🚀 Usage

You can import and use these utilities directly in your data pipelines.

from src.parser import load_data_from_file_into_2D_list, load_data_from_file_into_dictionary

# Load data into a nested list
data_table = load_data_from_file_into_2D_list('legacy_export.txt')

# Load data into a dictionary for easy key-value access
data_dict = load_data_from_file_into_dictionary('legacy_export.txt')

📸 Execution Output

Terminal Output

👨‍💻 Author

Agha Abdullah

⚖️ License

This project is licensed under the MIT License.

About

A lightweight, robust Python utility designed to parse proprietary text-based data formats into standard lists and dictionaries.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages