Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tomkinsc opened this issue Dec 12, 2024 · 0 comments
Open

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

tomkinsc opened this issue Dec 12, 2024 · 0 comments

Comments

@tomkinsc
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant