spreadsheet-handling
raw JSON → 0.1.0b5 verified Sat May 09 auth: no python
Composable pipelines for spreadsheets (JSON/YAML/CSV/XLSX) with FK helpers, validation, and IO routing. Version 0.1.0b5, requires Python >=3.10, pre-release beta with active development.
pip install spreadsheet-handling Common errors
error ModuleNotFoundError: No module named 'spreadsheet_handling' ↓
cause Attempted to import with hyphen instead of underscore.
fix
Use: import spreadsheet_handling
error ValueError: Invalid file extension '.xls' for reader ↓
cause Only .xlsx is supported for Excel files, not .xls (old format).
fix
Convert .xls files to .xlsx or CSV before using.
error ValidationError: Column 'email' is required ↓
cause Missing or empty column in input data.
fix
Ensure the input file contains the column 'email' with non-empty values.
Warnings
breaking Package is in beta (0.1.0b5). APIs may change without notice between minor versions. ↓
fix Pin to exact version in requirements.txt: spreadsheet-handling==0.1.0b5
gotcha Import path uses underscore: from spreadsheet_handling import ... not spreadsheet-handling. ↓
fix Use underscore in import statements.
deprecated The `.validate()` method signature may change in future betas. Currently expects a dict of column names and validation rules. ↓
fix Check changelog before upgrading; wrap validation in a try/except ValidationError.
Imports
- SheetPipeline wrong
from spreadsheet-handling import SheetPipelinecorrectfrom spreadsheet_handling import SheetPipeline - FkHelper wrong
from spreadsheet_handling.fk import FkHelpercorrectfrom spreadsheet_handling import FkHelper - ValidationError
from spreadsheet_handling import ValidationError
Quickstart
from spreadsheet_handling import SheetPipeline, FkHelper
import os
# Build a pipeline reading from CSV, adding FK lookup, and writing to JSON
pipeline = (
SheetPipeline()
.read_csv('input.csv')
.add_fk('dept_id', FkHelper(source='departments.csv', key_column='id', value_column='name'))
.validate({'dept_id': 'required'})
.write_json('output.json')
)
# Execute
pipeline.run()
print('Pipeline executed successfully.')