forgts is a Python package that extracts cell formatting from Excel files and applies it to great_tables objects, allowing for detailed and consistent data representation.
- Extracts formatting from Excel spreadsheets.
- Translates Excel formatting attributes to
great_tablescompatible formats. - Applies styling including font styles, colors, and borders to
great_tablesobjects.
To install forgts, use:
pip install forgtsThis package requires Python 3.11 and has dependencies on pandas, openpyxl, and great_tables.
Here's a basic example to get you started:
from forgts import format_gt_from_excel
# Format a Great Table from an Excel file
gt_object = format_gt_from_excel('./example/example.xlsx')
# Output the formatted GT object
gt_objectOutput
>INFO:forgts:Starting the formatting process from Excel.
>INFO:forgts:Extracting formatting information.
>INFO:forgts:Translating formatting to great_tables format.
>INFO:forgts:Applying formatting to the GT object.
>INFO:forgts:Formatting process completed.
├── .gitignore
├── LICENSE
├── README.md
├── _quarto.yml
├── custom.scss
├── docs
├── example
│ ├── example.ipynb
│ ├── example.png
│ └── example.xlsx
├── forgts
│ ├── __init__.py
│ ├── get_formatting.py
│ ├── styling.py
│ └── translate_formatting.py
├── index.qmd
├── poetry.lock
├── pyproject.toml
├── setup.py
└── tests
├── test__init__.py
├── test_get_formatting.py
├── test_styling.py
└── test_translate_formatting.py
Contributions are welcome! Please follow these steps:
- Fork this repository.
- Create a new branch:
git checkout -b feature-branch-name. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature-branch-name. - Submit a pull request.
This project is licensed under the MIT LICENSE.
This package was inspired by the R-package forgts by Luis D. Verde Arregoitia.
This repository was generated with cookiecutter.
Created by: Fernanda Aguirre Ruiz
