Skip to content

Replace open_or_gzopen() with smart_open() from external library #116

@tomkinsc

Description

@tomkinsc

We currently have a function, open_or_gzopen(), in util/file.py that provides a unified and somewhat flexible way to open various types of compressed files and return a file handle with an interface (largely) compatible with Python's built-in open().

We may want to consider replacing open_or_gzopen() with a call out to the more flexible and modern smart_open() function provided by the eponymous library, while preserving a function stub of open_or_gzopen() (with deprecation warning) to maintain compatibility for existing calls to open_or_gzopen().

In addition to supporting various compression types, smart_open() can also open data stored on cloud storage services like S3, GCS, and Azure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions