Skip to main content

Python function to extract data from an ODS spreadsheet on the fly - without having to store the entire file in memory or disk

Project description

stream-read-ods CircleCI Test Coverage

Python function to extract data from an ODS spreadsheet on the fly - without having to store the entire file in memory or disk

Installation

pip install stream-read-ods

Usage

from stream_read_ods import stream_read_ods
import httpx

def ods_chunks():
    # Iterable that yields the bytes of an ODS file
    with httpx.stream('GET', 'https://www.example.com/my.ods') as r:
        yield from r.iter_bytes(chunk_size=65536)

for name, rows in stream_read_ods(ods_chunks()):
    print(name)  # Sheet name
    for row in rows:
        print(row)  # Tuple of cells

Running tests

pip install -r requirements-dev.txt
pytest

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

stream-read-ods-0.0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

stream_read_ods-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page