Skip to main content

No project description provided

Project description

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.

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

xlstools-0.1.6.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

xlstools-0.1.6-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file xlstools-0.1.6.tar.gz.

File metadata

  • Download URL: xlstools-0.1.6.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for xlstools-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8d3a416a5fa583f483e9d3af49a28b076fe06f60bc410657edf92c986af4d959
MD5 857aab36f9c61ed9370272d70ce749a6
BLAKE2b-256 cd71b8afbff8e628775a5cedb7277735ad4321f115596e4c86437f746965fe8f

See more details on using hashes here.

File details

Details for the file xlstools-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: xlstools-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for xlstools-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 db1e9d049295b31b40938a4f869956133f42e695b405a17770d49675a12dae24
MD5 6b5177dc29d40cf39c6e5a7497e9a1bb
BLAKE2b-256 5632254ec5f0ac2862658d034e381e806617b8ec00b3288c967bae467625608c

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