Skip to main content

xls-tools

Excel and Excel-like tools

xlrd_like

A minimal interface for accessing excel-type files using the xlrd API:

XlrdLike: workbook equivalent

  • .sheet_names() - return list of sheet names
  • .sheet_by_name() - return an XlSheetLike given by name
  • .sheet_by_index() - return an XlSheetLike given by index
  • .sheets() - return a list of XlSheetLikes-- requires initializing every sheet

XlSheetLike: worksheet equivalent

  • .name - the name of the sheet according to the workbook
  • .nrows - int number of rows, 0-indexed
  • .ncols - int number of columns, 0-indexed
  • .row(n) - return a list of XlCellLike corresponding to the nth (0-indexed) row, or IndexError
  • .col(k) - return a list of XlCellLike corresponding to the kth (0-indexed) column, or IndexError
  • .cell(n,k) - return the nth row, kth cell, or IndexError
  • .get_rows() - row iterator
  • .row_dict(n) - return a dict of row n, using row 0 (headers) as keys and XlCellLike as values

XlCellLike: cell equivalent

  • .ctype - int, as indicated in xlrd
  • .value - native value

xlrd ctypes are as follows:

from xlrd.biffh import (
    XL_CELL_EMPTY,  # 0
    XL_CELL_TEXT,   # 1
    XL_CELL_NUMBER, # 2
    XL_CELL_DATE,   # 3
    XL_CELL_BOOLEAN,# 4
    # XL_CELL_ERROR, # 5
    # XL_CELL_BLANK, # 6 - for use in debugging, gathering stats, etc
)

To use:

>>> from xls_tools import open_xl
>>> xl = open_xl(filename)
>>>

Google sheets

Also provides an xlrd-like interface for accessing google sheets. Can also write to google sheets. For this you need credentials for Google's service API. See: Obtaining a service account

$ python setup.py install xls_tools[gsheet]

xl_reader and xl_sheet

Moderately clever sheets for auto-detecting tabular data in spreadsheets, and manipulating it. "Clever" enough to get in trouble perhaps.

Release files for xlstools 0.1.7

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

Source distribution (sdist)

Source distribution for xlstools 0.1.7
File Size Uploaded
xlstools-0.1.7.tar.gz 17.1 kB Details

Built distribution (wheel)

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

Total release size:36.3 kB

Release files / xlstools-0.1.7.tar.gz

Download URL xlstools-0.1.7.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fdbbec12887ad6b061c7fb33d3e0416965a3eb6aad82c07a0799fa420bc94dc5
BLAKE2b-256 checksum
How to use checksums
b3d2029f46d8111b57cf87426c7444627543d40439fbceb37b2f21e73542b710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / xlstools-0.1.7-py3-none-any.whl

Download URL xlstools-0.1.7-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3203d0641194376a8343c6f6690a554c5d2e4a45eb497be1d7fcbd6d7d799b6c
BLAKE2b-256 checksum
How to use checksums
c54bc7577febb59ddaafab118884cc3ba3e8599acd9239df5b9e385a82065c51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.7 This release

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