A pure-Python module for writing OpenDocument spreadsheets (similar to csv.writer).
Project description
odswriter
=========
A pure-Python module for writing OpenDocument spreadsheets (similar to csv.writer).
[![Build Status](https://travis-ci.org/mmulqueen/odswriter.png?branch=master)](https://travis-ci.org/mmulqueen/odswriter)
Features
-------------
- Pure python
- Automatically converts Python types into OpenDocument equivalents
- Includes support for datetime, date and time types
- Includes support for Decimal type
- Compatible with Python 2.7 and 3.3 (and probably others)
- Support for writing formulae (but not evaluating their results)
License
-----------
The MIT License (MIT), refer to LICENSE.txt
Example
---------
```python
import datetime
import decimal
import odswriter as ods
with ods.writer(open("test.ods","wb")) as odsfile:
odsfile.writerow(["String", "ABCDEF123456", "123456"])
# Lose the 2L below if you want to run this example code on Python 3, Python 3 has no long type.
odsfile.writerow(["Float", 1, 123, 123.123, 2L, decimal.Decimal("10.321")])
odsfile.writerow(["Date/DateTime", datetime.datetime.now(), datetime.date(1989,11,9)])
odsfile.writerow(["Time",datetime.time(13,37),datetime.time(16,17,18)])
odsfile.writerow(["Bool",True,False,True])
odsfile.writerow(["Formula",1,2,3,ods.Formula("IF(A1=2,B1,C1)")])
```
=========
A pure-Python module for writing OpenDocument spreadsheets (similar to csv.writer).
[![Build Status](https://travis-ci.org/mmulqueen/odswriter.png?branch=master)](https://travis-ci.org/mmulqueen/odswriter)
Features
-------------
- Pure python
- Automatically converts Python types into OpenDocument equivalents
- Includes support for datetime, date and time types
- Includes support for Decimal type
- Compatible with Python 2.7 and 3.3 (and probably others)
- Support for writing formulae (but not evaluating their results)
License
-----------
The MIT License (MIT), refer to LICENSE.txt
Example
---------
```python
import datetime
import decimal
import odswriter as ods
with ods.writer(open("test.ods","wb")) as odsfile:
odsfile.writerow(["String", "ABCDEF123456", "123456"])
# Lose the 2L below if you want to run this example code on Python 3, Python 3 has no long type.
odsfile.writerow(["Float", 1, 123, 123.123, 2L, decimal.Decimal("10.321")])
odsfile.writerow(["Date/DateTime", datetime.datetime.now(), datetime.date(1989,11,9)])
odsfile.writerow(["Time",datetime.time(13,37),datetime.time(16,17,18)])
odsfile.writerow(["Bool",True,False,True])
odsfile.writerow(["Formula",1,2,3,ods.Formula("IF(A1=2,B1,C1)")])
```
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
odswriter-0.1.2.tar.gz
(4.6 kB
view hashes)