Skip to main content

exex test codecov Code style: black

Extract data from Excel documents

Installation

pip install exex

Usage

Sample Excel file

Load Excel file

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

parse.values(sheet["A1"])
"name"

Single cell by row/column number

parse.values(sheet.cell(row=1, column=1)) 
"name"

Range of cells

parse.values(sheet["A1":"B2"])
[
  ["name", "abbreviation"],
  ["alpha", "a"],
]

All cells

parse.values(sheet.values)
[
  ["name", "abbreviation", "age"],
  ["alpha", "a", 1],
  ["beta", "b", 2],
  ["gamma", "g", 3],
]

Row by number

parse.values(sheet[1])
["alpha", "a", 1]

Range of rows

parse.values(sheet[1:2])
[
  ["name", "abbreviation", "age"],
  ["alpha", "a", 1],
]

Column by name

parse.values(sheet["A"])
["name", "alpha", "beta", "gamma"]

Rangge of columns

parse.values(sheet["A:B"])
[
  ["name", "alpha", "beta", "gamma"],
  ["abbreviation", "a", "b", "g"],
]

Ways to access sheets

# 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

poetry install

Tests (local Python version)

poetry run pytest

Tests (all Python versions defined in tox.ini)

poetry run tox

Code formatting (black)

poetry run black .

Release files for exex 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exex 1.0.0
File Size Uploaded
exex-1.0.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exex 1.0.0
File Interpreter ABI Platform
exex-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / exex-1.0.0.tar.gz

Download URL exex-1.0.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87e11648cc17f374fa96edbe32ff671e4787b0d1c9ab361508a5eced3eb529c0
BLAKE2b-256 checksum
How to use checksums
4a5a22148d7f39a9a40f3a4833c543915b3273a0376f33e75c1ca43c926767de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-90-generic

Release files / exex-1.0.0-py3-none-any.whl

Download URL exex-1.0.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b11ac64b81c9819dd4f9e275b9a957739c985810d50c4968c843e76059f17ea8
BLAKE2b-256 checksum
How to use checksums
b81695f81225bf3beb1dad0bd847b41bf0bf53a00f35ce7af35250e26772f65b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-90-generic

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page