smart-open
Utils for streaming large files (S3, HDFS, GCS, SFTP, Azure Blob Storage, gzip, bz2, zst...)
Decision gist · record as of 2026-08-14
Yes. smart_open is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. It solves a real pain point—unified remote file access—and is widely used (top 1000 on PyPI). Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs. The optional dependency model keeps the base install lightweight.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Optional storage backends (S3, GCS, Azure, etc.) require their respective client libraries installed separately via extras like 'smart_open[s3,gcs,azure]'.
- Low friction: pure Python wheel with a single lightweight runtime dependency (wrapt).
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-07-15 (30 days) · last repo commit 2026-08-04 · 3,456 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 72,785,991 downloads/mo, #458 on PyPI
Alternatives
Verify before relying
from smart_open import open
# Stream from S3
for line in open('s3://bucket/key.txt'):
print(line)
# Stream from local gzip file
with open('file.txt.gz', encoding='utf-8') as f:
content = f.read()- Performance characteristics and memory footprint compared to direct boto3 or cloud SDK usage for very large files.
- Compatibility and behavior differences when using seek() on remote storage backends.
- Whether all IOBase operations are fully supported across all transport types.
What it is and what it does
smart_open is a Python 3 library that wraps file access across multiple storage backends—S3, GCS, Azure Blob Storage, HDFS, WebHDFS, SFTP, HTTP, and local filesystems—under a single, drop-in replacement for Python's built-in open(). It handles the boilerplate and gotchas of each backend's native API, offering a clean, Pythonic interface for streaming large files without loading them entirely into memory. It also transparently handles on-the-fly compression and decompression for formats like gzip, bzip2, and zstd.
The library is production-stable, well-tested, and actively maintained. It depends only on wrapt at runtime, with optional dependencies for each storage backend. You install only what you need—by default, smart_open is lightweight, and you add support for S3, GCS, or other backends via extras. It's designed for data engineers, ML practitioners, and anyone working with large remote datasets who wants to avoid writing custom wrapper code around boto3, cloud SDKs, or Hadoop clients.
Use it for
- Stream training data from S3 or GCS directly into a machine learning pipeline without downloading entire datasets.
- Read and write large log files or data exports to Azure Blob Storage or HDFS using familiar Python file semantics.
- Transparently decompress gzip or bzip2 files on-the-fly while streaming from HTTP or SFTP sources.
- Migrate data between cloud storage backends (e.g., S3 to GCS) using a unified API without backend-specific code.
- Process compressed archives stored remotely without extracting them to disk first.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
smart_open is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. It solves a real pain point—unified remote file access—and is widely used (top 1000 on PyPI). Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs. The optional dependency model keeps the base install lightweight.
Install
smart-open on PyPI
Before you install
Low friction: pure Python wheel with a single lightweight runtime dependency (wrapt). Active maintenance with a release within the last 30 days and 3456 repository stars indicate steady, community-backed development.
Requires Python 3.10 or later. Optional storage backends (S3, GCS, Azure, etc.) require their respective client libraries installed separately via extras like 'smart_open[s3,gcs,azure]'.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from smart_open import open
# Stream from S3
for line in open('s3://bucket/key.txt'):
print(line)
# Stream from local gzip file
with open('file.txt.gz', encoding='utf-8') as f:
content = f.read()
Verify before relying
- Performance characteristics and memory footprint compared to direct boto3 or cloud SDK usage for very large files.
- Compatibility and behavior differences when using seek() on remote storage backends.
- Whether all IOBase operations are fully supported across all transport types.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagewrapt |
| Maintenance | Actively maintained 30 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 72,785,991 / month, #458 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Database :: Front-EndsTopic :: System :: Distributed Computing |
Evidence: smart_open-8.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “stream large files from s3”
- smart-openProvides a unified, open()-compatible Python API for streaming large…
- tabulatorReads and writes tabular data in multiple formats (CSV, XLS, JSON,…
- dataflows-tabulatorReads and writes tabular data in multiple formats (CSV, XLS, JSON,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework that enables you to define and call remote procedures across network boundaries using protocol buffers for serialization.
Install it if you need RPC communication in a distributed system or are integrating with existing gRPC services.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
Cloudpickle extends Python's standard pickle module to serialize lambda functions, interactively-defined functions and classes, and other constructs that the default pickle cannot handle, making it suitable for cluster computing and remote code execution.
Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
Ray is a distributed computing framework that scales Python applications from a single machine to multi-node clusters, providing abstractions for parallel tasks, stateful actors, and shared objects.
Kombu is a messaging library that provides a high-level Python interface to AMQP and other message brokers, supporting pluggable transports for RabbitMQ, Redis, MongoDB, Amazon SQS, and others.
Install it if you are building any distributed system that requires reliable message passing.
See also gzip-stream · blobfile · multi-storage-client · mosaicml-streaming · xopen · snakebite-py3 · pathy · hdfs · boostedblob · tentaclio