Skip to main content

Runs an Excel model (.xlsx) with parameters

Project description

xlsxecute

This tool will take an Excel model (.xlsx), update any parameters as defined via command line arguments or in the parameters file and calculate all cells, resulting in an Excel spreadsheet resembling the original, but with all formula cells replaced by the calculated values.

Parameters that define how to update cells in your spreadsheet can be provided in three ways: JSON file, CSV file, or command line arguments

If both a config file and command line arguments are provided, the command line arguments

Config file formatting

Only one config file can be provided at a time. The config file can either be

Command line arguments:

Command line arguments take the form of:

-f "Sheet name.Cell1=Replacement value string" -f "Sheet name.Cell2=Replacement_value_float"

Note: Quotation marks are not required if there no space in the parameter string.

Example:

xlsxecute -f "Variables.C2=red" -f Variables.C3=0.8 sample.xlsx

JSON:

{
   "Sheet name.Cell1": "Replacement value string",
   "Sheet name.Cell2": Replacement_value_float
}

Example: params.json

{
    "Variables.C2": "red",
    "Variables.C3": 0.8
}

CSV:

Sheet name.Cell1,Replacement value string
Sheet name.Cell2,Replacement value float

Example: params.csv

Variables.C2,red
Variables.C3,0.8

NOTE: Do NOT include a header row in the CSV



Executable usage:

usage: xlsxecute [-h] [--output_dir OUTPUT_DIR] [--run_dir RUN_DIR] [--param {sheet}.{cell}={new_value}] source_file [parameter_file]

positional arguments:
  source_file           Excel (xlsx) file that contains the model
  parameter_file        Path to json or csv parameter file

optional arguments:
  -h, --help            show this help message and exit
  --output_dir OUTPUT_DIR
                        Optional output location. (Default: output)
  --run_dir RUN_DIR     Optional directory to store intermediate files. (Default: runs)
  --param {sheet}.{cell}={new_value}, -p {sheet}.{cell}={new_value}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlsxecute-0.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

xlsxecute-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file xlsxecute-0.2.0.tar.gz.

File metadata

  • Download URL: xlsxecute-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.14.0-1029-oem

File hashes

Hashes for xlsxecute-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3472be88235d97e7ec5df71b740c487ca68bc8ce718c01e57a14e83a06db1a59
MD5 1fb824725221f295d9b1016ace29a07a
BLAKE2b-256 d81979f89d4e4556e220ab0ad796062cc8f748fd753ee0b8adecc79d383767df

See more details on using hashes here.

File details

Details for the file xlsxecute-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xlsxecute-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.14.0-1029-oem

File hashes

Hashes for xlsxecute-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e620fcfc7bed73a9d67f265b21dbc3f183e2b9b27551992e793660d23aed87a0
MD5 629737c46db7a4bec1232dff2c705d9f
BLAKE2b-256 25b09cd591bbfd94ed2d141451ceea86643414899ab206087ccc6560d2210c3d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page