Skip to main content

Extract data from Excel documents.

Project description

exex Build Status Code style: black

Extract data from Excel documents

Features

  • Extract data from Excel (xlsx)
  • Format result as JSON, JSONL, XML

Installation

pip install exex

Usage

Sample Excel file

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


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.5.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

exex-0.1.5-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file exex-0.1.5.tar.gz.

File metadata

  • Download URL: exex-0.1.5.tar.gz
  • Upload date:
  • Size: 3.3 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

Hashes for exex-0.1.5.tar.gz
Algorithm Hash digest
SHA256 df5724ce59a494fe2a955c18e4ede674e443079274b65a448e9beed08d9eae0e
MD5 e342b332964abcb0f359e5dc2b80773f
BLAKE2b-256 b2aa348c59d6ce07472ecb782f65b941159c25dbd18206778e34ae3b3dc5b557

See more details on using hashes here.

File details

Details for the file exex-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: exex-0.1.5-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

Hashes for exex-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 57b61dc8ab4fc5fade4a1f9dd78dfc264f507b9ebaa3fdca0347161a615693d5
MD5 2f0226617ae9d7ffe26b1dc03f81d9dd
BLAKE2b-256 bf17cee115f54f3c2c00d0322f9c1bf8ed0cf85be891e620bfde4c99db9bc1ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page