A CLI tool to convert SAP price list files into SAP upload templates and communication (comms) files. It supports default currency configuration, structured logging, and testable processing workflows.
This tool is part of an operational excellence effort to streamline and automate time-sensitive pricing cycle tasks.
- Python 3.12+
uv(recommended for dependency management)
uv syncuv tool install .The CLI uses subcommands:
sap— generate SAP upload onlycomms— generate comms files onlyfull— generate both
Examples:
If installed as a CLI tool:
pricing_cycle_tool -hOtherwise:
uv run -m transfer_pricing_cycle_tool.cli sap input/price_list.xlsbuv run -m transfer_pricing_cycle_tool.cli comms input/price_list.xlsb --ref input/ref1.xlsx --ref input/ref2.xlsxuv run -m transfer_pricing_cycle_tool.cli full input/price_list.xlsb --ref input/ref1.xlsx --ref input/ref2.xlsxYou can also pass multiple ref files via a comma-separated list:
uv run -m transfer_pricing_cycle_tool.cli full input/price_list.xlsb --ref input/ref1.xlsx,input/ref2.xlsxFiles are written under ./output:
output/sap_upload/sap_upload.xlsxoutput/comms/*.xlsx
Configuration is read from config.yaml (section forex_config, price_list_config, zvaz_config).
To avoid prompts for missing currencies, define defaults:
forex_config:
default_currencies:
- company_code: PL01
ticker: PLNIf a sending company is not configured, the tool will prompt for a currency.
Structured logs are emitted in JSON.
Each run writes a log file under ./logs in addition to stdout.
uv run pytest