excelstyleskit


Nameexcelstyleskit JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryA library to create excel styles
upload_time2025-02-05 23:12:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Angyee Marín Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords excel openpyxl styles
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ExcelStylesKit
## Table of contents
1. [What is this?](#what-is-this)
2. [Installation](#installation)
3. [Documentation](#documentation)
    - [Table Management](#table-management)
        - [Cell](#cell)
        - [Table](#table)
    - [Excel Management](#excel-management)
        - [Excel](#excel)
        - [ExcelStyles](#excelstyles)
---
# What is this?
*ExcelStylesKit* is a Python library that allows you to set the style of the cells of an Excel spreadsheet. 

# Installation
Available to install with pip
```bash
pip install excelstyleskit
```

# Documentation
- [Table Management](#table-management)
    - [Cell](#cell)
    - [Table](#table)
- [Excel Management](#excel-management)
    - [Excel](#excel)
    - [ExcelStyles](#excelstyles)
--- 
## Table Management
### Cell
#### *class* Cell(*column*, *row*)
Return a cell object based on the column and row.

##### Parameters
| Parameters | Type | Description             |
| ---------- | ---- | ----------------------- |
| column     | str  | The column of the cell. |
| row        | int  | The row of the cell.    |

##### Usage
```python
>>> from excelstyleskit import Cell
>>> cell = Cell('A', 1)
```

#### get_cell()
Return the cell in the format 'column' + 'row'.
**Return**: str

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Cell
>>> cell = Cell('A', 1)
>>> cell.get_cell()
'A1'
```

#### get_column()
Return the column of the cell.
**Return**: str

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Cell
>>> cell = Cell('A', 1)
>>> cell.get_column()
'A'
```

#### get_row()
Return the row of the cell.
**Return**: int

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Cell
>>> cell = Cell('A', 1)
>>> cell.get_row()
1
```

### Table
#### *class* table.Table(*first_column*, *first_row*, *last_column*, *last_row*)
Return a table object based on the first and last column and row.

##### Parameters
| Parameters    | Type | Description                      |
| ------------- | ---- | -------------------------------- |
| first_column  | str  | The initial column of the table. |
| first_row     | int  | The initial row of the table.    |
| last_column   | str  | The final column of the table.   |
| last_row      | int  | The final row of the table.      |

##### Usage
|   |   A  |   B  |   C  |   D  | 
|---|------|------|------|------|
| 1 |  A1  |  B1  |  C1  |  D1  | 
| 2 |  A2  |  B2  |  C2  |  D2  |
| 3 |  A3  |  B3  |  C3  |  D3  |
| 4 |  A4  |  B4  |  C4  |  D4  |


In this table, the first cell is the cell 'A1' and the last cell is the cell 'D4'.

```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
```

#### get_cells()
Return all cells (header and content) of the table.
**Return**: List[table.Cell]

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
>>> table.get_cells()
[<excelstyleskit.table.cell object, ...>]
```

#### add_row_header()
Add the all cells of a row as the header of the table.

##### Parameters
| Parameters | Type | Description             |
| ---------- | ---- | ----------------------- |
| row        | int  | The row to add as header.|

##### Usage
```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
>>> table.add_row_header(1)
```

#### get_cells_header()
Return the header cells (without cells content) of the table.
**Return**: List[table.Cell]

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
>>> table.add_row_header(1)
>>> table.get_cells_header()
[<excelstyleskit.table.cell object, ...>]
```

#### get_cells_content()
Return the content cells (without cells header) of the table.
**Return**: List[table.Cell]

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
>>> table.add_row_header(1)
>>> table.get_cells_content()
[<excelstyleskit.table.cell object, ...>]
```

#### select_row()
Return the all cells of a row.
**Return**: List[table.Cell]

##### Parameters
| Parameters | Type | Description                 |
| ---------- | ---- | --------------------------- |
| row        | int  | The row to filter the cells.|

##### Usage
```python
>>> from excelstyleskit import Table
>>> table = Table('A', 1, 'D', 4)
>>> table.select_row(1)
[<excelstyleskit.table.cell object, ...>]
```

#### get_cells_str()
Return a list with the cells in the format 'column' + 'row'.
**Returns**: List[str]

##### Parameters
| Parameters | Type             | Description            |
| ---------- | ---------------- | ---------------------- |
| cells      | List[table.Cell] | The cells to convert.  |

##### Usage
```python
>>> from excelstyleskit import Table
>>> cells = [Cell('A', 1), Cell('B', 1), Cell('C', 1), Cell('D', 1)]
>>> Table.get_cells_str(cells)
['A1', 'B1', 'C1', 'D1']
```

#### view_cells()
Prints all the cells in the format 'column' + 'row'.
**Returns**: *str*. The string of the cells that were printed.

##### Parameters
| Parameters | Type             | Description            |
| ---------- | ---------------- | ---------------------- |
| cells      | List[table.Cell] | The cells to print.    |

##### Usage
```python
>>> from excelstyleskit import Table
>>> cells = [Cell('A', 1), Cell('B', 1), Cell('C', 1), Cell('D', 1)]
>>> Table.view_cells(cells)
| A1 | B1 | C1 | D1 | 
```

## Excel Management
### Excel
#### *class* excel.Excel(*filepath*, *sheetname*)
Return an Excel object based on the filepath and sheetname.

##### Parameters
| Parameters | Type                 | Description                                                                                           |
| ---------- | -------------------- | ----------------------------------------------------------------------------------------------------- |
| filepath   | str                  | The filepath of the Excel spreadsheet.                                                                |
| sheetname  | str o None, optional | The name of the sheet. If it is not specified, the first sheet of the Excel spreadsheet will be used. |

##### Usage 
```python
>>> from excelstyleskit import Excel
>>> excel_sheet = Excel('path/to/file.xlsx', 'Sheet1')
>>> excel = Excel('path/to/file.xlsx')
```

#### set_table(*first_column*, *first_row*, *last_column*, *last_row*)
Set the table of the excel.

##### Parameters
| Parameters    | Type | Description                      |
| ------------- | ---- | -------------------------------- |
| first_column  | str  | The initial column of the table. |
| first_row     | int  | The initial row of the table.    |
| last_column   | str  | The final column of the table.   |
| last_row      | int  | The final row of the table.      |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_table('A', 1, 'D', 4)
```

#### add_row_header(*row*)
Add the all cells of a row as the header of the table.

##### Parameters
| Parameters | Type | Description             |
| ---------- | ---- | ----------------------- |
| row        | int  | The row to add as header.|

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_table('A', 1, 'D', 4)
>>> excel.add_row_header(1)
```

#### get_workbook()
Return the workbook of the excel.
**Returns**: *Workbook*

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_workbook()
<openpyxl.workbook.workbook.Workbook object>
```

#### get_worksheet()
Return the worksheet of the excel.
**Returns**: *Worksheet*

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_worksheet()
<openpyxl.worksheet.worksheet.Worksheet object>
```

#### get_table()
Return the object table of the excel.
**Returns**: *table.Table*

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_table()
<excelstyleskit.table.Table object>
```

#### save_work()
Save the changes in the excel.  

##### Parameters
None

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.save_work()
```

#### set_background_color_header(*start_color*, *end_color*)
Set the background color of the header of the table.

##### Parameters
| Parameters  | Type | Description                            |
| ----------  | ---- | -------------------------------------- |
| start_color | str  | The start color in hexadecimal format. |
| end_color   | str  | The end color in hexadecimal format.   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_background_color_header('FFFFFF', 'FFFFFF')
```

#### set_background_color_content(*start_color*, *end_color*)
Set the background color of the content of the table.

##### Parameters
| Parameters  | Type | Description                            |
| ----------  | ---- | -------------------------------------- |
| start_color | str  | The start color in hexadecimal format. |
| end_color   | str  | The end color in hexadecimal format.   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_background_color_content('FFFFFF', 'FFFFFF')
```

#### get_background_color_cell(*cell*)
Return the background color of the cell.
**Return**: str

##### Parameters
| Parameters | Type | Description                           |
| ---------- | ---- | ------------------------------------  |
| cell       | Cell | The cell to get the background color. |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_background_color_cell(Cell('A', 1))
'FFFFFF'
```

#### set_font_header(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)
Set the font of the header of the table.

##### Parameters
| Parameters | Type | Description                                                                                    |
| ---------- | ---- | ---------------------------------------------------------------------------------------------- |
| name       | str  | Name of the font.                                                                              |
| size       | int  | Size of the font.                                                                              |
| bold       | bool | True if the font is bold.                                                                      |
| italic     | bool | True if the font is italic.                                                                    |
| vertAlign  | str  | Value must be one of {‘superscript’, ‘baseline’, ‘subscript’} to the font.                     |
| underline  | str  | Value must be one of {‘single’, ‘double’, ‘doubleAccounting’, ‘singleAccounting’} to the font. |
| strike     | bool | True if the font is strike.                                                                    |
| color      | str  | The color of the font in hexadecimal format.                                                   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_font_header('Arial', 10, True, False, 'superscript', 'single', True, 'FFFF0000')
```

#### set_font_content(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)
Set the font of the content of the table.

##### Parameters
| Parameters | Type | Description                                                                                    |
| ---------- | ---- | ---------------------------------------------------------------------------------------------- |
| name       | str  | Name of the font.                                                                              |
| size       | int  | Size of the font.                                                                              |
| bold       | bool | True if the font is bold.                                                                      |
| italic     | bool | True if the font is italic.                                                                    |
| vertAlign  | str  | Value must be one of {‘superscript’, ‘baseline’, ‘subscript’} to the font.                     |
| underline  | str  | Value must be one of {‘single’, ‘double’, ‘doubleAccounting’, ‘singleAccounting’} to the font. |
| strike     | bool | True if the font is strike.                                                                    |
| color      | str  | The color of the font in hexadecimal format.                                                   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_font_content('Arial', 10, True, False, 'superscript', 'single', True, 'FFFF0000')
```

#### get_font_cell(*cell*)
Return the font of the cell.
**Return**: Font

##### Parameters
| Parameters | Type | Description                           |
| ---------- | ---- | ------------------------------------  |
| cell       | Cell | The cell to get the font.             |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_font_cell(Cell('A', 1))
<openpyxl.styles.font.Font object>
```

#### set_alignment_header(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)
Set the alignment of the header of the table.

##### Parameters
| Parameters         | Type | Description                                                                                               |
| ------------------ | ---- | --------------------------------------------------------------------------------------------------------- |
| horizontal         | str  | Value must be one of {‘left’, ‘center’, ‘right’, ‘fill’, ‘justify’, ‘centerContinuous’, ‘distributed’} to the horizontal. |
| vertical           | str  | Value must be one of {‘top’, ‘center’, ‘bottom’, ‘justify’, ‘distributed’} to the vertical.               |
| text_rotation      | int  | The rotation of the text.                                                                                 |
| wrap_text          | bool | True if the text is wrapped.                                                                              |
| shrink_to_fit      | bool | True if the text is shrink.                                                                               |
| indent             | int  | The indent of the text.                                                                                   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_alignment_header('left', 'center', 0, True, True, 1)
```

#### set_alignment_content(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)
Set the alignment of the content of the table.

##### Parameters
| Parameters         | Type | Description                                                                                               |
| ------------------ | ---- | --------------------------------------------------------------------------------------------------------- |
| horizontal         | str  | Value must be one of {‘left’, ‘center’, ‘right’, ‘fill’, ‘justify’, ‘centerContinuous’, ‘distributed’} to the horizontal. |
| vertical           | str  | Value must be one of {‘top’, ‘center’, ‘bottom’, ‘justify’, ‘distributed’} to the vertical.               |
| text_rotation      | int  | The rotation of the text.                                                                                 |
| wrap_text          | bool | True if the text is wrapped.                                                                              |
| shrink_to_fit      | bool | True if the text is shrink.                                                                               |
| indent             | int  | The indent of the text.                                                                                   |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_alignment_content('left', 'center', 0, True, True, 1)
```

#### get_alignment_cell(*cell*)
Return the alignment of the cell.
**Return**: Alignment

##### Parameters
| Parameters | Type | Description                           |
| ---------- | ---- | ------------------------------------  |
| cell       | Cell | The cell to get the alignment.        |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_alignment_cell(Cell('A', 1))
<openpyxl.styles.alignment.Alignment object>
```

#### set_border_header(*color*, *style*)
Set the border of the header of the table.

##### Parameters
| Parameters | Type | Description                                                                                               |
| ---------- | ---- | --------------------------------------------------------------------------------------------------------- |
| color      | str  | The color of the border in hexadecimal format.                                                            |
| style      | str  | Value must be one of {'dashDot','dashDotDot', 'dashed','dotted','double','hair', 'medium', 'mediumDashDot', 'mediumDashed', 'slantDashDot', 'thick', 'thin'} to the style. |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_border_header('000000', 'thin')
```

#### set_border_content(*color*, *style*)
Set the border of the content of the table.

##### Parameters
| Parameters | Type | Description                                                                                               |
| ---------- | ---- | --------------------------------------------------------------------------------------------------------- |
| color      | str  | The color of the border in hexadecimal format.                                                            |
| style      | str  | Value must be one of {'dashDot','dashDotDot', 'dashed','dotted','double','hair', 'medium', 'mediumDashDot', 'mediumDashed', 'slantDashDot', 'thick', 'thin'} to the style. |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_border_content('000000', 'thin')
```

#### get_border_cell(*cell*)
Return the border of the cell.
**Return**: Border

##### Parameters
| Parameters | Type | Description                  |
| ---------- | ---- | ---------------------------- |
| cell       | Cell | The cell to get the border.  |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_border_cell(Cell('A', 1))
<openpyxl.styles.border.Border object>
```

#### set_height_row_header(*height*)
Set the height of the row header of the table.

##### Parameters
| Parameters | Type | Description             |
| ---------- | ---- | ----------------------- |
| height     | int  | The height of the row.  |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_height_row_header(12.75)
```

#### set_height_row_content(*height*)
Set the height of the row content of the table.

##### Parameters
| Parameters | Type | Description             |
| ---------- | ---- | ----------------------- |
| height     | int  | The height of the row.  |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_height_row_content(12.75)
```

#### get_height_row_cell(*cell*)
Return the height of the row of a cell.
**Return**: int

##### Parameters
| Parameters | Type | Description                  |
| ---------- | ---- | ---------------------------- |
| cell       | Cell | The cell to get the height.  |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_height_row_cell(Cell('A', 1))
12.75
```

#### set_width_column_table(*width*)
Set the width of the column of the table.

##### Parameters
| Parameters | Type | Description              |
| ---------- | ---- | ------------------------ |
| width      | int  | The width of the column. |

##### Usage
```python
>>> from excelstyleskit import Excel
>>> excel = Excel('path/to/file.xlsx')
>>> excel.set_width_column_table(15)
```

#### get_width_column_cell(*cell*)
Return the width of the column of a cell.
**Return**: int

##### Parameters
| Parameters | Type | Description                  |
| ---------- | ---- | ---------------------------- |
| cell       | Cell | The cell to get the width.   |

##### Usage
```python
>>> from excelstyleskit import Excel, Cell
>>> excel = Excel('path/to/file.xlsx')
>>> excel.get_width_column_cell(Cell('A', 1))
11.53
```
### ExcelStyles
#### ExcelStyles.set_background_color(*worksheet*, *cells*, *fill*)
Set the background color of the cells.

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells      | List[table.Cell]                       | The cells to set the background color.       |
| fill       | openpyxl.styles.PatternFill            | The fill of the cells.                       |

##### Usage
The use of this method must be through the use of the method: 
- [`set_background_color_header(*start_color*, *end_color*)`](#set_background_color_headerstart_color-end_color)
- [`set_background_color_content(*start_color*, *end_color*)`](#set_background_color_content-start_color-end_color)

#### ExcelStyles.get_background_color(*worksheet*, *cell*)
Return the background color of the cell.
**Return**: str

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the background color.        |

##### Usage
The use of this method must be through the use of the method: 
- [`get_background_color_cell(*cell*)`](#get_background_color_cellcell)

#### ExcelStyles.set_font(*worksheet*, *cells*, *font*)
Set the font of the cells.

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells      | List[table.Cell]                       | The cells to set the font.                   |
| font       | openpyxl.styles.Font                   | The font of the cells.                       |

##### Usage
The use of this method must be through the use of the method: 
- [`set_font_header(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)`](#set_font_headername-size-bold-italic-vertalign-underline-strike-color)
- [`set_font_content(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)`](#set_font_contentname-size-bold-italic-vertalign-underline-strike-color)

#### ExcelStyles.get_font(*worksheet*, *cell*)
Return the font of the cell.
**Return**: Font

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the font.                    |

##### Usage
The use of this method must be through the use of the method: 
- [`get_font_cell(*cell*)`](#get_font_cellcell)

#### ExcelStyles.set_alignment(*worksheet*, *cells*, *alignment*)
Set the alignment of the cells.

##### Parameters
| Parameters         | Type                                   | Description                                  |
| ------------------ | -------------------------------------- | -------------------------------------------- |
| worksheet          | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells              | List[table.Cell]                       | The cell to set the alignment.               |
| alignment          | openpyxl.styles.Alignment              | The alignment of the cells.                  |

##### Usage
The use of this method must be through the use of the method: 
- [`set_alignment_header(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)`](#set_alignment_headerhorizontal-vertical-text_rotation-wrap_text-shrink-indent)
- [`set_alignment_content(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)`](#set_alignment_contenthorizontal-vertical-text_rotation-wrap_text-shrink-indent)

#### ExcelStyles.get_alignment(*worksheet*, *cell*)
Return the alignment of the cell.
**Return**: Alignment

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the alignment.               |

##### Usage
The use of this method must be through the use of the method: 
- [`get_alignment_cell(*cell*)`](#get_alignment_cellcell)

#### ExcelStyles.set_border(*worksheet*, *cells*, *border*)
Set the border of the cells.

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells      | List[table.Cell]                       | The cells to set the border.                 |
| border     | openpyxl.styles.Border                 | The border to set.                           |

##### Usage
The use of this method must be through the use of the method: 
- [`set_border_header(*color*, *style*)`](#set_border_headercolor-style)
- [`set_border_content(*color*, *style*)`](#set_border_contentcolor-style)

#### ExcelStyles.get_border(*worksheet*, *cell*)
Return the border of the cell.
**Return**: Border

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the border.                  |

##### Usage
The use of this method must be through the use of the method: 
- [`get_border_cell(*cell*)`](#get_border_cellcell)

#### ExcelStyles.set_height(*worksheet*, *cells*, *height*)
Set the height of the cells.

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells      | List[table.Cell]                       | The cell to set the height.                  |
| height     | int                                    | The height of the cell.                      |

##### Usage
The use of this method must be through the use of the method: 
- [`set_height_row_header(*height*)`](#set_height_row_headerheight)
- [`set_height_row_content(*height*)`](#set_height_row_contentheight)

#### ExcelStyles.get_height(*worksheet*, *cell*)
Return the height of the cell.
**Return**: int

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the height.                  |

##### Usage
The use of this method must be through the use of the method: 
- [`get_height_row_cell(*cell*)`](#get_height_row_cellcell)

#### ExcelStyles.set_width(*worksheet*, *cells*, *width*)
Set the width of the cells.

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cells      | List[table.Cell]                       | The cell to set the width.                   |
| width      | int                                    | The width of the cell.                       |

##### Usage
The use of this method must be through the use of the method: 
- [`set_width_column_table(*width*)`](#set_width_column_tablewidth)

#### ExcelStyles.get_width(*worksheet*, *cell*)
Return the width of the cell.
**Return**: int

##### Parameters
| Parameters | Type                                   | Description                                  |
| ---------- | -------------------------------------- | -------------------------------------------- |
| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |
| cell       | table.Cell                             | The cell to get the width.                   |

##### Usage
The use of this method must be through the use of the method: 
- [`get_width_column_cell(*cell*)`](#get_width_column_cellcell) 
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "excelstyleskit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "excel, openpyxl, styles",
    "author": null,
    "author_email": "Angyee <angyeemarin.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/89/ad/6754f59193df9f7c60d2e76a538518fd91b05aa79c4c3722d7d82fd5a969/excelstyleskit-0.0.3.tar.gz",
    "platform": null,
    "description": "# ExcelStylesKit\n## Table of contents\n1. [What is this?](#what-is-this)\n2. [Installation](#installation)\n3. [Documentation](#documentation)\n    - [Table Management](#table-management)\n        - [Cell](#cell)\n        - [Table](#table)\n    - [Excel Management](#excel-management)\n        - [Excel](#excel)\n        - [ExcelStyles](#excelstyles)\n---\n# What is this?\n*ExcelStylesKit* is a Python library that allows you to set the style of the cells of an Excel spreadsheet. \n\n# Installation\nAvailable to install with pip\n```bash\npip install excelstyleskit\n```\n\n# Documentation\n- [Table Management](#table-management)\n    - [Cell](#cell)\n    - [Table](#table)\n- [Excel Management](#excel-management)\n    - [Excel](#excel)\n    - [ExcelStyles](#excelstyles)\n--- \n## Table Management\n### Cell\n#### *class* Cell(*column*, *row*)\nReturn a cell object based on the column and row.\n\n##### Parameters\n| Parameters | Type | Description             |\n| ---------- | ---- | ----------------------- |\n| column     | str  | The column of the cell. |\n| row        | int  | The row of the cell.    |\n\n##### Usage\n```python\n>>> from excelstyleskit import Cell\n>>> cell = Cell('A', 1)\n```\n\n#### get_cell()\nReturn the cell in the format 'column' + 'row'.\n**Return**: str\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Cell\n>>> cell = Cell('A', 1)\n>>> cell.get_cell()\n'A1'\n```\n\n#### get_column()\nReturn the column of the cell.\n**Return**: str\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Cell\n>>> cell = Cell('A', 1)\n>>> cell.get_column()\n'A'\n```\n\n#### get_row()\nReturn the row of the cell.\n**Return**: int\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Cell\n>>> cell = Cell('A', 1)\n>>> cell.get_row()\n1\n```\n\n### Table\n#### *class* table.Table(*first_column*, *first_row*, *last_column*, *last_row*)\nReturn a table object based on the first and last column and row.\n\n##### Parameters\n| Parameters    | Type | Description                      |\n| ------------- | ---- | -------------------------------- |\n| first_column  | str  | The initial column of the table. |\n| first_row     | int  | The initial row of the table.    |\n| last_column   | str  | The final column of the table.   |\n| last_row      | int  | The final row of the table.      |\n\n##### Usage\n|   |   A  |   B  |   C  |   D  | \n|---|------|------|------|------|\n| 1 |  A1  |  B1  |  C1  |  D1  | \n| 2 |  A2  |  B2  |  C2  |  D2  |\n| 3 |  A3  |  B3  |  C3  |  D3  |\n| 4 |  A4  |  B4  |  C4  |  D4  |\n\n\nIn this table, the first cell is the cell 'A1' and the last cell is the cell 'D4'.\n\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n```\n\n#### get_cells()\nReturn all cells (header and content) of the table.\n**Return**: List[table.Cell]\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n>>> table.get_cells()\n[<excelstyleskit.table.cell object, ...>]\n```\n\n#### add_row_header()\nAdd the all cells of a row as the header of the table.\n\n##### Parameters\n| Parameters | Type | Description             |\n| ---------- | ---- | ----------------------- |\n| row        | int  | The row to add as header.|\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n>>> table.add_row_header(1)\n```\n\n#### get_cells_header()\nReturn the header cells (without cells content) of the table.\n**Return**: List[table.Cell]\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n>>> table.add_row_header(1)\n>>> table.get_cells_header()\n[<excelstyleskit.table.cell object, ...>]\n```\n\n#### get_cells_content()\nReturn the content cells (without cells header) of the table.\n**Return**: List[table.Cell]\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n>>> table.add_row_header(1)\n>>> table.get_cells_content()\n[<excelstyleskit.table.cell object, ...>]\n```\n\n#### select_row()\nReturn the all cells of a row.\n**Return**: List[table.Cell]\n\n##### Parameters\n| Parameters | Type | Description                 |\n| ---------- | ---- | --------------------------- |\n| row        | int  | The row to filter the cells.|\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> table = Table('A', 1, 'D', 4)\n>>> table.select_row(1)\n[<excelstyleskit.table.cell object, ...>]\n```\n\n#### get_cells_str()\nReturn a list with the cells in the format 'column' + 'row'.\n**Returns**: List[str]\n\n##### Parameters\n| Parameters | Type             | Description            |\n| ---------- | ---------------- | ---------------------- |\n| cells      | List[table.Cell] | The cells to convert.  |\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> cells = [Cell('A', 1), Cell('B', 1), Cell('C', 1), Cell('D', 1)]\n>>> Table.get_cells_str(cells)\n['A1', 'B1', 'C1', 'D1']\n```\n\n#### view_cells()\nPrints all the cells in the format 'column' + 'row'.\n**Returns**: *str*. The string of the cells that were printed.\n\n##### Parameters\n| Parameters | Type             | Description            |\n| ---------- | ---------------- | ---------------------- |\n| cells      | List[table.Cell] | The cells to print.    |\n\n##### Usage\n```python\n>>> from excelstyleskit import Table\n>>> cells = [Cell('A', 1), Cell('B', 1), Cell('C', 1), Cell('D', 1)]\n>>> Table.view_cells(cells)\n| A1 | B1 | C1 | D1 | \n```\n\n## Excel Management\n### Excel\n#### *class* excel.Excel(*filepath*, *sheetname*)\nReturn an Excel object based on the filepath and sheetname.\n\n##### Parameters\n| Parameters | Type                 | Description                                                                                           |\n| ---------- | -------------------- | ----------------------------------------------------------------------------------------------------- |\n| filepath   | str                  | The filepath of the Excel spreadsheet.                                                                |\n| sheetname  | str o None, optional | The name of the sheet. If it is not specified, the first sheet of the Excel spreadsheet will be used. |\n\n##### Usage \n```python\n>>> from excelstyleskit import Excel\n>>> excel_sheet = Excel('path/to/file.xlsx', 'Sheet1')\n>>> excel = Excel('path/to/file.xlsx')\n```\n\n#### set_table(*first_column*, *first_row*, *last_column*, *last_row*)\nSet the table of the excel.\n\n##### Parameters\n| Parameters    | Type | Description                      |\n| ------------- | ---- | -------------------------------- |\n| first_column  | str  | The initial column of the table. |\n| first_row     | int  | The initial row of the table.    |\n| last_column   | str  | The final column of the table.   |\n| last_row      | int  | The final row of the table.      |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_table('A', 1, 'D', 4)\n```\n\n#### add_row_header(*row*)\nAdd the all cells of a row as the header of the table.\n\n##### Parameters\n| Parameters | Type | Description             |\n| ---------- | ---- | ----------------------- |\n| row        | int  | The row to add as header.|\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_table('A', 1, 'D', 4)\n>>> excel.add_row_header(1)\n```\n\n#### get_workbook()\nReturn the workbook of the excel.\n**Returns**: *Workbook*\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_workbook()\n<openpyxl.workbook.workbook.Workbook object>\n```\n\n#### get_worksheet()\nReturn the worksheet of the excel.\n**Returns**: *Worksheet*\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_worksheet()\n<openpyxl.worksheet.worksheet.Worksheet object>\n```\n\n#### get_table()\nReturn the object table of the excel.\n**Returns**: *table.Table*\n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_table()\n<excelstyleskit.table.Table object>\n```\n\n#### save_work()\nSave the changes in the excel.  \n\n##### Parameters\nNone\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.save_work()\n```\n\n#### set_background_color_header(*start_color*, *end_color*)\nSet the background color of the header of the table.\n\n##### Parameters\n| Parameters  | Type | Description                            |\n| ----------  | ---- | -------------------------------------- |\n| start_color | str  | The start color in hexadecimal format. |\n| end_color   | str  | The end color in hexadecimal format.   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_background_color_header('FFFFFF', 'FFFFFF')\n```\n\n#### set_background_color_content(*start_color*, *end_color*)\nSet the background color of the content of the table.\n\n##### Parameters\n| Parameters  | Type | Description                            |\n| ----------  | ---- | -------------------------------------- |\n| start_color | str  | The start color in hexadecimal format. |\n| end_color   | str  | The end color in hexadecimal format.   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_background_color_content('FFFFFF', 'FFFFFF')\n```\n\n#### get_background_color_cell(*cell*)\nReturn the background color of the cell.\n**Return**: str\n\n##### Parameters\n| Parameters | Type | Description                           |\n| ---------- | ---- | ------------------------------------  |\n| cell       | Cell | The cell to get the background color. |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_background_color_cell(Cell('A', 1))\n'FFFFFF'\n```\n\n#### set_font_header(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)\nSet the font of the header of the table.\n\n##### Parameters\n| Parameters | Type | Description                                                                                    |\n| ---------- | ---- | ---------------------------------------------------------------------------------------------- |\n| name       | str  | Name of the font.                                                                              |\n| size       | int  | Size of the font.                                                                              |\n| bold       | bool | True if the font is bold.                                                                      |\n| italic     | bool | True if the font is italic.                                                                    |\n| vertAlign  | str  | Value must be one of {\u2018superscript\u2019, \u2018baseline\u2019, \u2018subscript\u2019} to the font.                     |\n| underline  | str  | Value must be one of {\u2018single\u2019, \u2018double\u2019, \u2018doubleAccounting\u2019, \u2018singleAccounting\u2019} to the font. |\n| strike     | bool | True if the font is strike.                                                                    |\n| color      | str  | The color of the font in hexadecimal format.                                                   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_font_header('Arial', 10, True, False, 'superscript', 'single', True, 'FFFF0000')\n```\n\n#### set_font_content(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)\nSet the font of the content of the table.\n\n##### Parameters\n| Parameters | Type | Description                                                                                    |\n| ---------- | ---- | ---------------------------------------------------------------------------------------------- |\n| name       | str  | Name of the font.                                                                              |\n| size       | int  | Size of the font.                                                                              |\n| bold       | bool | True if the font is bold.                                                                      |\n| italic     | bool | True if the font is italic.                                                                    |\n| vertAlign  | str  | Value must be one of {\u2018superscript\u2019, \u2018baseline\u2019, \u2018subscript\u2019} to the font.                     |\n| underline  | str  | Value must be one of {\u2018single\u2019, \u2018double\u2019, \u2018doubleAccounting\u2019, \u2018singleAccounting\u2019} to the font. |\n| strike     | bool | True if the font is strike.                                                                    |\n| color      | str  | The color of the font in hexadecimal format.                                                   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_font_content('Arial', 10, True, False, 'superscript', 'single', True, 'FFFF0000')\n```\n\n#### get_font_cell(*cell*)\nReturn the font of the cell.\n**Return**: Font\n\n##### Parameters\n| Parameters | Type | Description                           |\n| ---------- | ---- | ------------------------------------  |\n| cell       | Cell | The cell to get the font.             |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_font_cell(Cell('A', 1))\n<openpyxl.styles.font.Font object>\n```\n\n#### set_alignment_header(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)\nSet the alignment of the header of the table.\n\n##### Parameters\n| Parameters         | Type | Description                                                                                               |\n| ------------------ | ---- | --------------------------------------------------------------------------------------------------------- |\n| horizontal         | str  | Value must be one of {\u2018left\u2019, \u2018center\u2019, \u2018right\u2019, \u2018fill\u2019, \u2018justify\u2019, \u2018centerContinuous\u2019, \u2018distributed\u2019} to the horizontal. |\n| vertical           | str  | Value must be one of {\u2018top\u2019, \u2018center\u2019, \u2018bottom\u2019, \u2018justify\u2019, \u2018distributed\u2019} to the vertical.               |\n| text_rotation      | int  | The rotation of the text.                                                                                 |\n| wrap_text          | bool | True if the text is wrapped.                                                                              |\n| shrink_to_fit      | bool | True if the text is shrink.                                                                               |\n| indent             | int  | The indent of the text.                                                                                   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_alignment_header('left', 'center', 0, True, True, 1)\n```\n\n#### set_alignment_content(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)\nSet the alignment of the content of the table.\n\n##### Parameters\n| Parameters         | Type | Description                                                                                               |\n| ------------------ | ---- | --------------------------------------------------------------------------------------------------------- |\n| horizontal         | str  | Value must be one of {\u2018left\u2019, \u2018center\u2019, \u2018right\u2019, \u2018fill\u2019, \u2018justify\u2019, \u2018centerContinuous\u2019, \u2018distributed\u2019} to the horizontal. |\n| vertical           | str  | Value must be one of {\u2018top\u2019, \u2018center\u2019, \u2018bottom\u2019, \u2018justify\u2019, \u2018distributed\u2019} to the vertical.               |\n| text_rotation      | int  | The rotation of the text.                                                                                 |\n| wrap_text          | bool | True if the text is wrapped.                                                                              |\n| shrink_to_fit      | bool | True if the text is shrink.                                                                               |\n| indent             | int  | The indent of the text.                                                                                   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_alignment_content('left', 'center', 0, True, True, 1)\n```\n\n#### get_alignment_cell(*cell*)\nReturn the alignment of the cell.\n**Return**: Alignment\n\n##### Parameters\n| Parameters | Type | Description                           |\n| ---------- | ---- | ------------------------------------  |\n| cell       | Cell | The cell to get the alignment.        |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_alignment_cell(Cell('A', 1))\n<openpyxl.styles.alignment.Alignment object>\n```\n\n#### set_border_header(*color*, *style*)\nSet the border of the header of the table.\n\n##### Parameters\n| Parameters | Type | Description                                                                                               |\n| ---------- | ---- | --------------------------------------------------------------------------------------------------------- |\n| color      | str  | The color of the border in hexadecimal format.                                                            |\n| style      | str  | Value must be one of {'dashDot','dashDotDot', 'dashed','dotted','double','hair', 'medium', 'mediumDashDot', 'mediumDashed', 'slantDashDot', 'thick', 'thin'} to the style. |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_border_header('000000', 'thin')\n```\n\n#### set_border_content(*color*, *style*)\nSet the border of the content of the table.\n\n##### Parameters\n| Parameters | Type | Description                                                                                               |\n| ---------- | ---- | --------------------------------------------------------------------------------------------------------- |\n| color      | str  | The color of the border in hexadecimal format.                                                            |\n| style      | str  | Value must be one of {'dashDot','dashDotDot', 'dashed','dotted','double','hair', 'medium', 'mediumDashDot', 'mediumDashed', 'slantDashDot', 'thick', 'thin'} to the style. |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_border_content('000000', 'thin')\n```\n\n#### get_border_cell(*cell*)\nReturn the border of the cell.\n**Return**: Border\n\n##### Parameters\n| Parameters | Type | Description                  |\n| ---------- | ---- | ---------------------------- |\n| cell       | Cell | The cell to get the border.  |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_border_cell(Cell('A', 1))\n<openpyxl.styles.border.Border object>\n```\n\n#### set_height_row_header(*height*)\nSet the height of the row header of the table.\n\n##### Parameters\n| Parameters | Type | Description             |\n| ---------- | ---- | ----------------------- |\n| height     | int  | The height of the row.  |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_height_row_header(12.75)\n```\n\n#### set_height_row_content(*height*)\nSet the height of the row content of the table.\n\n##### Parameters\n| Parameters | Type | Description             |\n| ---------- | ---- | ----------------------- |\n| height     | int  | The height of the row.  |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_height_row_content(12.75)\n```\n\n#### get_height_row_cell(*cell*)\nReturn the height of the row of a cell.\n**Return**: int\n\n##### Parameters\n| Parameters | Type | Description                  |\n| ---------- | ---- | ---------------------------- |\n| cell       | Cell | The cell to get the height.  |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_height_row_cell(Cell('A', 1))\n12.75\n```\n\n#### set_width_column_table(*width*)\nSet the width of the column of the table.\n\n##### Parameters\n| Parameters | Type | Description              |\n| ---------- | ---- | ------------------------ |\n| width      | int  | The width of the column. |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.set_width_column_table(15)\n```\n\n#### get_width_column_cell(*cell*)\nReturn the width of the column of a cell.\n**Return**: int\n\n##### Parameters\n| Parameters | Type | Description                  |\n| ---------- | ---- | ---------------------------- |\n| cell       | Cell | The cell to get the width.   |\n\n##### Usage\n```python\n>>> from excelstyleskit import Excel, Cell\n>>> excel = Excel('path/to/file.xlsx')\n>>> excel.get_width_column_cell(Cell('A', 1))\n11.53\n```\n### ExcelStyles\n#### ExcelStyles.set_background_color(*worksheet*, *cells*, *fill*)\nSet the background color of the cells.\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells      | List[table.Cell]                       | The cells to set the background color.       |\n| fill       | openpyxl.styles.PatternFill            | The fill of the cells.                       |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_background_color_header(*start_color*, *end_color*)`](#set_background_color_headerstart_color-end_color)\n- [`set_background_color_content(*start_color*, *end_color*)`](#set_background_color_content-start_color-end_color)\n\n#### ExcelStyles.get_background_color(*worksheet*, *cell*)\nReturn the background color of the cell.\n**Return**: str\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the background color.        |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_background_color_cell(*cell*)`](#get_background_color_cellcell)\n\n#### ExcelStyles.set_font(*worksheet*, *cells*, *font*)\nSet the font of the cells.\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells      | List[table.Cell]                       | The cells to set the font.                   |\n| font       | openpyxl.styles.Font                   | The font of the cells.                       |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_font_header(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)`](#set_font_headername-size-bold-italic-vertalign-underline-strike-color)\n- [`set_font_content(*name*, *size*, *bold*, *italic*, *vertAlign*, *underline*, *strike*, *color*)`](#set_font_contentname-size-bold-italic-vertalign-underline-strike-color)\n\n#### ExcelStyles.get_font(*worksheet*, *cell*)\nReturn the font of the cell.\n**Return**: Font\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the font.                    |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_font_cell(*cell*)`](#get_font_cellcell)\n\n#### ExcelStyles.set_alignment(*worksheet*, *cells*, *alignment*)\nSet the alignment of the cells.\n\n##### Parameters\n| Parameters         | Type                                   | Description                                  |\n| ------------------ | -------------------------------------- | -------------------------------------------- |\n| worksheet          | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells              | List[table.Cell]                       | The cell to set the alignment.               |\n| alignment          | openpyxl.styles.Alignment              | The alignment of the cells.                  |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_alignment_header(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)`](#set_alignment_headerhorizontal-vertical-text_rotation-wrap_text-shrink-indent)\n- [`set_alignment_content(*horizontal*, *vertical*, *text_rotation*, *wrap_text*, *shrink*, *indent*)`](#set_alignment_contenthorizontal-vertical-text_rotation-wrap_text-shrink-indent)\n\n#### ExcelStyles.get_alignment(*worksheet*, *cell*)\nReturn the alignment of the cell.\n**Return**: Alignment\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the alignment.               |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_alignment_cell(*cell*)`](#get_alignment_cellcell)\n\n#### ExcelStyles.set_border(*worksheet*, *cells*, *border*)\nSet the border of the cells.\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells      | List[table.Cell]                       | The cells to set the border.                 |\n| border     | openpyxl.styles.Border                 | The border to set.                           |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_border_header(*color*, *style*)`](#set_border_headercolor-style)\n- [`set_border_content(*color*, *style*)`](#set_border_contentcolor-style)\n\n#### ExcelStyles.get_border(*worksheet*, *cell*)\nReturn the border of the cell.\n**Return**: Border\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the border.                  |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_border_cell(*cell*)`](#get_border_cellcell)\n\n#### ExcelStyles.set_height(*worksheet*, *cells*, *height*)\nSet the height of the cells.\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells      | List[table.Cell]                       | The cell to set the height.                  |\n| height     | int                                    | The height of the cell.                      |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_height_row_header(*height*)`](#set_height_row_headerheight)\n- [`set_height_row_content(*height*)`](#set_height_row_contentheight)\n\n#### ExcelStyles.get_height(*worksheet*, *cell*)\nReturn the height of the cell.\n**Return**: int\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the height.                  |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_height_row_cell(*cell*)`](#get_height_row_cellcell)\n\n#### ExcelStyles.set_width(*worksheet*, *cells*, *width*)\nSet the width of the cells.\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cells      | List[table.Cell]                       | The cell to set the width.                   |\n| width      | int                                    | The width of the cell.                       |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`set_width_column_table(*width*)`](#set_width_column_tablewidth)\n\n#### ExcelStyles.get_width(*worksheet*, *cell*)\nReturn the width of the cell.\n**Return**: int\n\n##### Parameters\n| Parameters | Type                                   | Description                                  |\n| ---------- | -------------------------------------- | -------------------------------------------- |\n| worksheet  | openpyxl.worksheet.worksheet.Worksheet | The worksheet of the excel.                  |\n| cell       | table.Cell                             | The cell to get the width.                   |\n\n##### Usage\nThe use of this method must be through the use of the method: \n- [`get_width_column_cell(*cell*)`](#get_width_column_cellcell) ",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Angyee Mar\u00edn\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A library to create excel styles",
    "version": "0.0.3",
    "project_urls": {
        "Changelog": "https://github.com/xanv754/ExcelStylesKit/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/xanv754/ExcelStylesKit/blob/main/documentation.md",
        "Issues": "https://github.com/xanv754/ExcelStylesKit/issues",
        "Repository": "https://github.com/xanv754/ExcelStylesKit"
    },
    "split_keywords": [
        "excel",
        " openpyxl",
        " styles"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ffbf86a85877fcdc1fb272ec702df4599131fb612d73ef511282946d5ca32a28",
                "md5": "8f51246b6ebe7966d595214077650e17",
                "sha256": "4e9185be1cc7552e3d05bbf2a7e411b8cff17c49af21ad5fc4f27f2e769d18c7"
            },
            "downloads": -1,
            "filename": "excelstyleskit-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f51246b6ebe7966d595214077650e17",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16032,
            "upload_time": "2025-02-05T23:12:03",
            "upload_time_iso_8601": "2025-02-05T23:12:03.326063Z",
            "url": "https://files.pythonhosted.org/packages/ff/bf/86a85877fcdc1fb272ec702df4599131fb612d73ef511282946d5ca32a28/excelstyleskit-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "89ad6754f59193df9f7c60d2e76a538518fd91b05aa79c4c3722d7d82fd5a969",
                "md5": "b21c52d8312759edd4188facd91ba0da",
                "sha256": "78f6c04368922178837d26560de86ffcc3efc90b427c532fbad66760cba3f437"
            },
            "downloads": -1,
            "filename": "excelstyleskit-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b21c52d8312759edd4188facd91ba0da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19095,
            "upload_time": "2025-02-05T23:12:06",
            "upload_time_iso_8601": "2025-02-05T23:12:06.006061Z",
            "url": "https://files.pythonhosted.org/packages/89/ad/6754f59193df9f7c60d2e76a538518fd91b05aa79c4c3722d7d82fd5a969/excelstyleskit-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-05 23:12:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xanv754",
    "github_project": "ExcelStylesKit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "excelstyleskit"
}
        
Elapsed time: 0.44166s