A small Python program for processing and analyzing numeric datasets. It can take input either from the command line or from CSV/JSON files. The operations are organized around a simple state machine.
├── main.py # Entry point
├── work/
│ ├── ops.py # Statistic operation
│ ├── io_utils.py # Input da CLI / CSV / JSON and output
│ └── init.py
├── user_interface/
│ ├── menu.py # Menu control (CLI)
│ └── init.py
├── tests/
│ ├── test_ops.py # Operation test
│ └── test_io_utils.py # Test I/O
└── pytest.ini
python3 main.pyStores data and provides statistical operations. Uses a function dictionary to avoid repeated calls. Implements:
- Count, Sum, Min, Max, Mean
- Median, Mode
- Variance, Standard deviation
- Quantile, Interquartile range
- z-Scores
- Covariance and Correlation (for paired datasets)
- Manual numeric input
- Load from CSV or JSON (with automatic header handling)
- Save results to file (JSON or CSV)
- Text-based interaction
- Controlled by a simple state machine in
main.py
Unit tests implemented with pytest.
Run from the project root:
pytest -qAll current tests (9 total) validate both the mathematical correctness and file-handling robustness.
Design Notes
The point of this project was mainly to practice clean module separation and state-based control. Whit This layout allows adding new features or replacing components without modifying the entire codebase.
Known Limitations
- JSON loader returns full Datablock objects; no partial loading yet.
- Numeric input validation is minimal.
- UI is CLI-only (no GUI, no API).
Author’s Note
This code was developed to practice a clean modular workflow and will serve as a base for future projects.