Skip to content

jayvdb/pyexcel

 
 

Repository files navigation

pyexcel - Let you focus on data, instead of file formats

image

image

image

Known constraints

Fonts, colors and charts are not supported.

Feature Highlights

  1. One API to handle multiple data sources:
    • physical file
    • memory file
    • SQLAlchemy table
    • Django Model
    • Python data stuctures: dictionary, records and array
  2. One application programming interface(API) to read and write data in various excel file formats.

Available Plugins

Plugins Supported file formats
pyexcel-io csv, csvz, tsv, tsvz
pyexcel-xls xls, xlsx(r), xlsm(r)
pyexcel-xlsx xlsx
pyexcel-ods ods (python 2.6, 2.7 only)
pyexcel-ods3 ods

pyexcel-text

(write only)json, rst, mediawiki,latex, grid, pipe, orgtbl, plain simple

Installation

You can install it via pip:

$ pip install pyexcel

or clone it and install it:

$ git clone http://github.com/pyexcel/pyexcel.git
$ cd pyexcel
$ python setup.py install

Installation of individual plugins , please refer to individual plugin page.

Usage

JSON

>>> import pyexcel as pe
>>> an_array = [[1,2]]
>>> sheet = pe.Sheet(an_array)
>>> sheet.json
'{"pyexcel sheet": [[1, 2]]}'

Note: It is available with pyexcel v0.2.1 and pyexcel-text 0.2.0

TSV

>>> sheet.tsv
'1\t2\r\n'

Note: TSV and the rest of the formats are available with pyexcel v0.2.2 and its plugins at version 0.2.0+ only

CSV

>>> sheet.csv
'1,2\r\n'

Documentation

Documentation is hosted at read the docs and pyhosted

Deveopment guide

Development steps for code changes

  1. git clone https://github.com/pyexcel/pyexcel.git
  2. cd pyexcel
  3. pip install -r requirements.txt
  4. pip install -r tests/requirements.txt

In order to update test envrionment, and documentation, additional setps are required:

  1. pip install moban
  2. git clone https://github.com/pyexcel/pyexcel-commons.git
  3. make your changes in .moban.d directory, then issue command moban

How to test your contribution

Although nose and doctest are both used in code testing, it is adviable that unit tests are put in tests. doctest is incorporated only to make sure the code examples in documentation remain valid across different development releases.

On Linux/Unix systems, please launch your tests like this:

$ make test

On Windows systems, please issue this command:

> test.bat

License

New BSD License

Acknowledgement

All great work have done by odf, ezodf(2), xlrd, xlwt, tabulate and other individual developers. This library unites only the data access code.

Extension management code was reused from flask.

About

Python Wrapper that provides one API for reading, manipulating and writing csv, ods, xls, xlsx and xlsm files

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Other 0.2%