python-calamine-0.6.2
توضیحات
Python binding for Rust's library for reading excel and odf file - calamine
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | python-calamine-0.6.2 |
| نام | python-calamine |
| نسخه کتابخانه | 0.6.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Dmitriy <dimastbk@proton.me> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/python-calamine/ |
| مجوز | - |
# python-calamine
[](https://pypi.org/project/python-calamine/)
[](https://anaconda.org/conda-forge/python-calamine)

Python binding for beautiful Rust's library for reading excel and odf file - [calamine](https://github.com/tafia/calamine).
### Is used
* [calamine](https://github.com/tafia/calamine)
* [pyo3](https://github.com/PyO3/pyo3)
* [maturin](https://github.com/PyO3/maturin)
### Installation
Pypi:
```
pip install python-calamine
```
Conda:
```
conda install -c conda-forge python-calamine
```
### Example
```python
from python_calamine import CalamineWorkbook
workbook = CalamineWorkbook.from_path("file.xlsx")
workbook.sheet_names
# ["Sheet1", "Sheet2"]
workbook.get_sheet_by_name("Sheet1").to_python()
# [
# ["1", "2", "3", "4", "5", "6", "7"],
# ["1", "2", "3", "4", "5", "6", "7"],
# ["1", "2", "3", "4", "5", "6", "7"],
# ]
```
By default, calamine skips empty rows/cols before data. For suppress this behaviour, set `skip_empty_area` to `False`.
```python
from python_calamine import CalamineWorkbook
workbook = CalamineWorkbook.from_path("file.xlsx").get_sheet_by_name("Sheet1").to_python(skip_empty_area=False)
# [
# [", ", ", ", ", ", "],
# ["1", "2", "3", "4", "5", "6", "7"],
# ["1", "2", "3", "4", "5", "6", "7"],
# ["1", "2", "3", "4", "5", "6", "7"],
# ]
```
Pandas 2.2 and above have built-in support of python-calamine.
Also, you can find additional examples in [tests](https://github.com/dimastbk/python-calamine/blob/master/tests/test_base.py).
### Development
You'll need rust [installed](https://rustup.rs/).
```shell
# clone this repo or your fork
git clone git@github.com:dimastbk/python-calamine.git
cd python-calamine
# create a new virtual env
python3 -m venv env
source env/bin/activate
# install dev dependencies and install python-calamine
pip install --group dev -e . # required pip 25.1 and above
# lint code
pre-commit run --all-files
# test code
pytest
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl python-calamine-0.6.2:
pip install python-calamine-0.6.2.whl
نصب پکیج tar.gz python-calamine-0.6.2:
pip install python-calamine-0.6.2.tar.gz