Extract data from Excel documents.
Project description
exex
Extract data from Excel documents
Installation
pip install exex
Usage
Use openpyxl
to grab data
from openpyxl import load_workbook
book = load_workbook("sample.xlsx")
# Sheets
book.sheetnames # (array) sheet names
book.sheets[0] # (sheet) first sheet
book.sheets["prices"] # (sheet) sheet by name
book.active # (sheet) active sheet
# Grab cells from active sheet
sheet = book.active
sheet["A1"] # (value) single cell by name
sheet.cell(row=1, column=1) # (value) single cell by row/column
sheet["A1":"B2"] # (array) range of cells
sheet.values # (array) all cells
sheet[5] # (array) single row
sheet[5:10] # (array) range of rows
sheet["C"] # (array) single column
sheet["A:C"] # (array) range of columns
Use exex.parse.values()
to get values
from exex import parse
parse.values(sheet["A1"])
parse.values(sheet.cell(row=1, column=1))
parse.values(sheet["A1":"B2"])
parse.values(sheet.values)
parse.values(sheet[5])
parse.values(sheet[5:10])
parse.values(sheet["C"])
parse.values(sheet["A:C"])
Development
Tests (local Python version)
poetry run pytest
Tests (all Python versions defined in tox.ini
)
poetry run tox
Code formatting (black)
poetry run black .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
exex-0.1.6.tar.gz
(3.2 kB
view details)
Built Distribution
exex-0.1.6-py3-none-any.whl
(3.1 kB
view details)
File details
Details for the file exex-0.1.6.tar.gz
.
File metadata
- Download URL: exex-0.1.6.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.17 CPython/3.8.0 Linux/4.15.0-66-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b22de0be1e4f2cd10c9852bfc003cd229d78b7b58813eb84bb3fe693dd6f05 |
|
MD5 | 623369f0fa9440adb02a8d74018e74e7 |
|
BLAKE2b-256 | 3cf224c4cf8d7a89e8577b31f4f77a34ab8f2cf968903b054d936c486f298a87 |
File details
Details for the file exex-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: exex-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.17 CPython/3.8.0 Linux/4.15.0-66-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83d73ef5f04b105fbd0d5e0d02b03c4706f6566b1663654ebbae05826fd9ade2 |
|
MD5 | 1391cbc98d9543831dc858c79dab6ffd |
|
BLAKE2b-256 | 1abef5af177f0d92befe4ea16bb60a43a641b82dc1ea0fae3bb3ae42a98d2672 |