Metadata-Version: 2.1
Name: autoxlsx
Version: 0.2.0
Summary: 
Author: KhalidCK
Author-email: khalidCK@win.local
Requires-Python: >=3.7,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: click (>=7.1.2,<8.0.0)
Requires-Dist: openpyxl (>=3.0.3,<4.0.0)
Requires-Dist: pyyaml (>=5.3.1,<6.0.0)
Description-Content-Type: text/markdown

# README

When you need to carrefully fill-out an Excel file, it can be tricky.

It's even worse when the sheet is so ugly that it kind of burn your soul every time you open it.

This package try to tackle optimise that: writing plain yaml and never open the damn Excel file again.

## Install

```shell
pip install autoxlsx
```

## How to use

A simple workbook

**myugly.xlsx**

![excelTable](img/eg_simple.png)

`Name`,`function` & `age` are inputs others (E) are calculated by Excel formula.

### Write model

Usually people are picky about their excel format, so I expect this part to be quite static.

**Model.yaml**

```yaml
- sheetname: mysheet
  parameters:
    #that's an employee first name
    - parameter: "name"
      position: "C4"
    #here you have a function
    #note: nobody care
    - parameter: "function"
      position: "C5"
    #same nobody care but put something
    - parameter: "age"
      position: "C6"
```
### Write values

This part that will change often.

**Values.yaml**

```yaml
mysheet.name: Bob
mysheet.function: Sword man
mysheet.age: 42
```

The key use a dot notation to point to a specific value in the whole workbook. Note that parameter are defined in the `model.yaml`

### Update excel

Use the cli utility.

It will update inplace the excel file writing to the correct cells.

```shell
autoxlsx model.yaml values.yaml myugly.xlsx
```

## Example

See `tests/data/` for more example
