Python function to construct an ODS spreadsheet on the fly - without having to store the entire file in memory or disk
Project description
stream-write-ods
Python function to construct an ODS spreadsheet on the fly - without having to store the entire file in memory or disk
Work in progress. This README serves as a rough design spec.
Installation
pip install stream-write-ods
Usage
def get_sheets():
def get_rows_of_sheet_1():
yield 'Value A', 'Value B'
yield 'Value C', 'Value D'
yield 'Sheet 1 name', ('col_1_name', 'col_2_name'), get_rows_of_sheet_1()
def get_rows_of_sheet_2():
yield 'col_1_value',
yield 'Sheet 2 name', ('col_1_name',), get_rows_of_sheet_2()
ods_chunks = stream_write_ods(get_sheets())
Types
There are 8 possible data types in an Open Document Spreadsheet: boolean, currency, date, float, percentage, string, time, and void. 5 of these can be output by stream-write-ods, chosen automatically according to the following table.
Python type | ODS type |
---|---|
boolean | boolean |
date | date - without time component |
datetime | date - with time component |
int | float |
float | float |
str | string |
NoneType | void |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stream-write-ods-0.0.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for stream_write_ods-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9127bc786cdd0c88f6342c5b56f09e0f93c49ddb55fb35c0f094f5d1cb1d7152 |
|
MD5 | 01b5f201c2b17f73796ffdf2776b5b3d |
|
BLAKE2b-256 | 0226f85e351637d9452246ac7c3d4f40ea11a22bf8340d0717b7e3b7a11efc67 |