Giter VIP home page Giter VIP logo

xlrd's Introduction

xlrd

Build Status Coverage Status Documentation PyPI version

xlrd is a library for reading data and formatting information from Excel files in the historical .xls format.

Warning

This library will no longer read anything other than .xls files. For alternatives that read newer file formats, please see http://www.python-excel.org/.

The following are also not supported but will safely and reliably be ignored:

  • Charts, Macros, Pictures, any other embedded object, including embedded worksheets.
  • VBA modules
  • Formulas, but results of formula calculations are extracted.
  • Comments
  • Hyperlinks
  • Autofilters, advanced filters, pivot tables, conditional formatting, data validation

Password-protected files are not supported and cannot be read by this library.

Quick start:

pip install xlrd
import xlrd
book = xlrd.open_workbook("myfile.xls")
print("The number of worksheets is {0}".format(book.nsheets))
print("Worksheet name(s): {0}".format(book.sheet_names()))
sh = book.sheet_by_index(0)
print("{0} {1} {2}".format(sh.name, sh.nrows, sh.ncols))
print("Cell D30 is {0}".format(sh.cell_value(rowx=29, colx=3)))
for rx in range(sh.nrows):
    print(sh.row(rx))

From the command line, this will show the first, second and last rows of each sheet in each file:

python PYDIR/scripts/runxlrd.py 3rows *blah*.xls

xlrd's People

Contributors

aaronmader avatar alicederyn avatar andyfaff avatar chrismac4u avatar cjw296 avatar endeepak avatar frewsxcv avatar gthb avatar helix84 avatar jdufresne avatar jmcnamara avatar klassmann avatar larserikh avatar lopuhin avatar michael-k avatar mlorant avatar nayyarv avatar patrickfuller avatar rossjones avatar scop avatar sjmachin avatar stephenlewis avatar suvit avatar takluyver avatar timgates42 avatar tltx avatar tonal avatar upman avatar vainu-jussi avatar vog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.