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
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. 4 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 | string - as #NA |
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.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for stream_write_ods-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28bf60b3fa8ac3775d704253ecedfb840dbd35b1d663737e2838ab7fa34a11ab |
|
MD5 | 15299f467d4c21089890243e26e7a454 |
|
BLAKE2b-256 | c5c301a79fa6e10f256af42834568aa953d9f752d9170e423c6a21b259107f70 |