exex-1.0.0
توضیحات
Extract data from Excel documents.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX |
| نام فایل | exex-1.0.0 |
| نام | exex |
| نسخه کتابخانه | 1.0.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Viktor Persson |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/vikpe/exex |
| آدرس اینترنتی | https://pypi.org/project/exex/ |
| مجوز | MIT |
# exex  [](https://codecov.io/gh/vikpe/exex) [](https://github.com/psf/black)
> Extract data from Excel documents
## Installation
```sh
pip install exex
```
## Usage

**Load Excel file**
```python
from openpyxl import load_workbook
from exex import parse
book = load_workbook("sample.xlsx") # load excel file
sheet = book.active # get active sheet
```
**Single cell by name**
```python
parse.values(sheet["A1"])
"name"
```
**Single cell by row/column number**
```python
parse.values(sheet.cell(row=1, column=1))
"name"
```
**Range of cells**
```python
parse.values(sheet["A1":"B2"])
[
["name", "abbreviation"],
["alpha", "a"],
]
```
**All cells**
```python
parse.values(sheet.values)
[
["name", "abbreviation", "age"],
["alpha", "a", 1],
["beta", "b", 2],
["gamma", "g", 3],
]
```
**Row by number**
```python
parse.values(sheet[1])
["alpha", "a", 1]
```
**Range of rows**
```python
parse.values(sheet[1:2])
[
["name", "abbreviation", "age"],
["alpha", "a", 1],
]
```
**Column by name**
```python
parse.values(sheet["A"])
["name", "alpha", "beta", "gamma"]
```
**Rangge of columns**
```python
parse.values(sheet["A:B"])
[
["name", "alpha", "beta", "gamma"],
["abbreviation", "a", "b", "g"],
]
```
**Ways to access sheets**
```python
# Sheets
book.sheets[0] # (sheet) sheet by index
book.sheets["prices"] # (sheet) sheet by name
book.active # (sheet) active sheet
book.sheetnames # (array) sheet names
```
## Development
**Setup**
```sh
poetry install
```
**Tests** (local Python version)
```sh
poetry run pytest
```
**Tests** (all Python versions defined in `tox.ini`)
```sh
poetry run tox
```
**Code formatting** (black)
```sh
poetry run black .
```
نیازمندی
| مقدار | نام |
|---|---|
| >=3.0,<4.0 | openpyxl |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.2,<4.0.0 | Python |
نحوه نصب
نصب پکیج whl exex-1.0.0:
pip install exex-1.0.0.whl
نصب پکیج tar.gz exex-1.0.0:
pip install exex-1.0.0.tar.gz