Skip to main content

dlt-filesystem

Read files from local disks, object stores, file servers and cloud drives with dlt, and write them back out.

The package started inside omniload and now ships on its own, so any dlt project can build on it. Issues and pull requests are welcome.

What's inside

dlt-filesystem's readers and filesystem are compatible with dlt's dlt.sources.filesystem. While dlt reads CSV, JSONL and Parquet, plus CSV through DuckDB, dlt-filesystem features readers for 17 file formats.

The package provides 19 storage sources for local files, HTTP, object stores, file servers and cloud drives. These include S3, Azure, SFTP, WebDAV, Google Drive and SharePoint.

For storage destinations, omniload supports local files, Amazon S3 and S3-compatible object storage, Google Cloud Storage, Azure Blob Storage and ADLS Gen2.

Install

The base installation covers most file formats for reading and writing.

pip install dlt-filesystem

To enable additional formats or storage backends, install the required extras. The full extra includes all optional dependencies.

pip install 'dlt-filesystem[full]'

Usage

Both examples load into DuckDB, so they also need pip install duckdb.

The readers source works like dlt's, with one resource per reader. Point bucket_url at your own bucket, with credentials configured the way dlt expects:

import dlt
from dlt_filesystem.source.adapter import readers

pipeline = dlt.pipeline(destination="duckdb", dataset_name="inbox")
pipeline.run(
    readers(bucket_url="s3://bucket/prefix", file_glob="*.parquet").read_parquet()
)

The source classes take a URI and pick the reader from the file name. This one reads data/events.csv under the working directory:

import dlt
from dlt_filesystem.source.fsspec.local import LocalFilesystemSource

pipeline = dlt.pipeline(destination="duckdb", dataset_name="inbox")
pipeline.run(
    LocalFilesystemSource().dlt_source("file://data/events.csv", table=""),
    table_name="events",
)

File formats

The source classes take the format from the file extension, or from a #format hint (file://feed.dat#csv). The S3, R2, GCS, Azure and SFTP sources read the hint from the table argument rather than the URI. A .gz suffix is skipped when choosing the format, so events.csv.gz reads as CSV.

Format Keys Read Write Extra
CSV (Polars) csv yes yes
CSV without a header csv_headless yes no
CSV (DuckDB) csv_duckdb yes no duckdb
JSON json yes yes
JSON Lines jsonl yes yes
Parquet parquet yes yes
ORC orc yes yes
Avro avro yes yes
Feather V2 (Arrow IPC) feather, arrow, ipc yes yes
Vortex vortex yes yes vortex
Excel xlsx yes yes spreadsheet
OpenDocument ods yes no spreadsheet
BSON bson yes no bson
CBOR cbor yes yes iterable
MessagePack msgpack yes yes iterable
XML xml yes no iterable
YAML yaml, yml yes yes

The Write column is what the file:// destination writes. The bucket destinations write dlt's own file formats.

Writing Avro needs Polars 2.1 or later, and so Python 3.11 or newer. On an earlier Polars the destination refuses when it writes, naming the version, because those releases write a corrupt file for a list column holding an empty list before a non-empty one. Avro through Polars has no timestamp with a zone and no time of day: a timestamp with a zone is written as the same instant in UTC without the zone, and reads back as that UTC wall time, and a time of day is written as text.

Sources

Each storage system has a source class whose dlt_source(uri, table) returns a dlt resource. The scheme column is the URI scheme omniload routes to the class.

Storage Scheme Class Backend
Local files file source.fsspec.local.LocalFilesystemSource pyarrow.fs
HTTP and HTTPS http, https source.fsspec.http.HttpFilesystemSource fsspec HTTP
Amazon S3 and S3-compatible stores s3 source.impl.remote.S3Source pyarrow.fs
Cloudflare R2 r2 source.fsspec.r2.R2Source pyarrow.fs
Google Cloud Storage gs source.impl.remote.GCSSource gcsfs
Azure Blob Storage, ADLS Gen2 az, adls, abfss source.impl.remote.AzureSource pyarrow.fs
SFTP sftp source.impl.remote.SFTPSource fsspec SFTP (paramiko)
FTP ftp source.fsspec.ftp.FTPSource fsspec FTP
HDFS hdfs source.fsspec.hdfs.HDFSSource pyarrow.fs
WebHDFS webhdfs source.fsspec.webhdfs.WebHDFSSource fsspec WebHDFS
SMB (Windows shares) smb source.fsspec.smb.SMBSource fsspec SMB (smbprotocol)
WebDAV http+webdav, https+webdav source.fsspec.webdav.WebdavSource webdav4
Oracle Cloud Object Storage oci source.fsspec.oci.OCISource ocifs (oci extra)
Alibaba Cloud OSS oss source.fsspec.oss.OSSSource ossfs
Dropbox dropbox source.fsspec.dropbox.DropboxSource dropboxdrivefs
Google Drive gdrive source.fsspec.gdrive.GoogleDriveSource gdrive-fsspec
SharePoint sharepoint, msgd source.fsspec.sharepoint.SharePointSource msgraphfs
OneDrive onedrive source.fsspec.onedrive.OneDriveSource msgraphfs
Databricks (UC Volumes, Workspace files, DBFS) dbfs source.fsspec.databricks.DatabricksSource fsspec-databricks

Class paths are relative to dlt_filesystem. The Python packages behind every backend install with the base package, except ocifs, which needs the oci extra. HDFS also needs Hadoop's native libhdfs library, which pyarrow loads at runtime. An s3:// URI may leave out the keys, see S3 credentials.

Destinations

Storage Scheme Class Writes
Local file file target.local.LocalFilesystemDestination One file, in any format marked Write above
Amazon S3 and S3-compatible s3 target.remote.S3Destination dlt's filesystem layout
Google Cloud Storage gs target.remote.GCSDestination dlt's filesystem layout
Azure Blob Storage, ADLS Gen2 az, adls, abfss target.remote.AzureDestination dlt's filesystem layout

The file:// destination takes its format from the extension or a #format hint, as the sources do. It loads through dlt into a temporary directory, then writes the rows to the named file without dlt's _dlt_* columns. The bucket destinations hand the load to dlt's filesystem destination, write one table per run, and leave out dlt's dataset directory level. A layout query parameter sets dlt's file layout.

With no query parameters, or only layout, the bucket destinations leave credentials to dlt. In .dlt/secrets.toml, use [destination.BlobFS.credentials] (the TOML section name is case-sensitive), or set DESTINATION__BLOBFS__CREDENTIALS__... environment variables. With any other query parameters, missing or blank required URI credential options raise an error. Unset credential fields can still resolve from dlt's configuration, including fields inside decoded GCS credentials. The S3 destination also accepts endpoint_url and region without a key pair, as described under S3 credentials.

S3 credentials

An s3:// URI that names neither access_key_id nor secret_access_key leaves the keys to the AWS SDK's default credential chain, which starts with the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN environment variables. That is how an AWS Lambda function receives its execution role's temporary credentials. endpoint_url and region still apply, so s3://?endpoint_url=http://localhost:4566 reaches an emulator with credentials from the environment. Arrow, which serves S3 reads, ignores AWS_ENDPOINT_URL, while botocore, behind the destination and object staging, honours it. Put an S3-compatible endpoint in the URI so reads and writes reach the same service.

Naming a key, even with a blank value, requires both, so access_key_id= is an error rather than a fallback to the environment. So do dlt's own spellings (aws_access_key_id, aws_secret_access_key, aws_session_token) and session_token, which the URI does not take. Without keys, the URI may name only endpoint_url and region (and layout on the destination). Any other option is an error naming it, so a misspelled endpont_url or regoin does not run the job against AWS's default endpoint and region. A blank endpoint_url= or region= is an error too. This applies to the S3 source, destination and object staging. r2:// keeps requiring both keys, since the AWS default chain does not hold R2 credentials.

The destination classes are adapters rather than dlt destination factories. They expose dlt_dest, dlt_run_params and post_load, the interface omniload calls, and dlt_dest returns the dlt destination to load into.

Comparison with dlt

dlt-filesystem's readers and filesystem accept every keyword argument dlt's versions accept, so a pipeline on dlt's filesystem source moves across by changing the import, as long as it passes kwargs, client_kwargs and incremental by keyword, and passes reader options such as chunksize or columns as call arguments or URI hints. dlt's readers also resolve those options from dlt config and environment variables; these readers do not.

read_jsonl and read_parquet take the same options as dlt's. read_parquet defaults to chunksize=1000 and yields at most that many rows per batch, as lists of row dictionaries or, with use_pyarrow=True, pyarrow.RecordBatch objects.

The CSV readers differ:

  • read_csv takes Polars' read_csv options, where dlt's takes Pandas' and also opens the file with any encoding it is given. Both read_csv and read_csv_headless yield at most chunksize rows per batch (10,000 by default), but load each file into a Polars frame first. The limit bounds emitted row lists, not parsing memory.
  • read_csv_duckdb forwards a caller's filename=True option to DuckDB, where dlt adds a filename field to each record itself.
  • read_csv_duckdb defaults to chunk_size=50000, compared with dlt's 5,000. It also accepts chunksize, which takes precedence over chunk_size.

filesystem() also accepts require_file_match=True, which raises when the selection matches no file instead of loading an empty table. The source classes in the sources turn it on when the URI names one file, and leave globs free to match nothing.

For incremental loads by modification date, the lister reads the date from what each backend's listing returns. dlt's lookup table has no entry for r2, oss, hdfs, webhdfs, smb, ftp, dbfs or oci, and it expects a backend-specific key that the Arrow-backed S3 and Azure clients do not carry. Over HTTP an incremental load needs a valid Last-Modified header. WebDAV is addressed over HTTP too, and asks the WebDAV server for each file's date.

Extras

Some formats and storage backends require optional dependencies. If a dependency is missing, the error names the extra to install.

Install one or multiple extras:

pip install 'dlt-filesystem[spreadsheet,vortex]'

Available extras:

Extra Adds
bson BSON (pymongo)
duckdb The DuckDB CSV reader, csv_duckdb
iterable CBOR and MessagePack (read and write), XML (read)
oci Oracle Cloud Object Storage, the oci source
spreadsheet XLSX (read and write) and ODS (read)
vortex Vortex (read and write), Python 3.11 and later
full All of the above (Vortex only on Python 3.11 and later)

Documentation

See the omniload documentation for connection options and per-format reader hints: https://omniload.readthedocs.io/supported-sources/filesystem.html

License

MIT. See LICENSE.

Metadata

Release files for dlt-filesystem 0.29.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dlt-filesystem 0.29.1
File Size Uploaded Provenance Actions
dlt_filesystem-0.29.1.tar.gz 222.9 kB With provenance Details for dlt_filesystem-0.29.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dlt-filesystem 0.29.1
File Interpreter ABI Platform Actions
dlt_filesystem-0.29.1-py3-none-any.whl Python 3 none any Details for dlt_filesystem-0.29.1-py3-none-any.whl

Total release size: 370.7 kB

Release files / dlt_filesystem-0.29.1.tar.gz

Download URL dlt_filesystem-0.29.1.tar.gz
Size 222.9 kB
Tags Source
SHA-256 checksum
How to use checksums
35ebd96ff2dc107d48e5b8ee5a544fe899260131a965649df7460ce465c94df1
BLAKE2b-256 checksum
How to use checksums
7fe00e9aa90478f6be241f1d3098c8c253c1c749af76988a8f5fb8a8e8e4f379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / dlt_filesystem-0.29.1-py3-none-any.whl

Download URL dlt_filesystem-0.29.1-py3-none-any.whl
Size 147.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70df556ec074f1f0b4518675e778780c7f307a1c70336858d8e56d2af421eb0e
BLAKE2b-256 checksum
How to use checksums
2896286a19e87f64b3d24ea00f1ef58cb0895180d504da48d8f44d1f3a17e903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for dlt-filesystem 0.29.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dlt_filesystem-0.29.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page