Skip to content

Releases

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 12 Nov 01:13
v0.4.1
3000ddd

A fix of 0.4.0's packaging: the strategies now require the interface they were built for.

Fixes

  • The strategies' interface: fsspec-alt-strategies-impl 0.4.0 accepted any interface from 0.1, but needs 0.4's, e.g. its UNKNOWN. Installed beside an older interface, it failed on import. 0.4.1 requires fsspec-alt-strategies>=0.4,<0.5.

Install

Upgrade both, if you installed the strategies from PyPI:

pip install -U fsspec-alt-strategies fsspec-alt-strategies-impl

A copy of the strategies made from 0.4.0 needs nothing: its code is unchanged, and your package requires the interface itself.

What's Changed

  • 0.4.1: the strategies require the interface of their own minor version by @sugibuchi in #8

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 12 Nov 00:14
v0.4.0
79b81c7

Storage profiles loaded where the operation runs, and routers that fit more storages, with a breaking change. The library is still in alpha.

New

  • Profiles loaded at the operation's paths: _load_storage_profile(path) is given a path of the operation that needs the profile. A filesystem can ask the storage where its credential is allowed, e.g. a container a SAS is limited to.
  • A profile for unknown storages: UNKNOWN, StorageProfile(), is the profile of a storage nothing is known of, right on any storage. It is every filesystem's default.
  • Routers typed by their storages: AsyncRoutingFileSystem[S3FileSystem] names the class of a router's inner filesystems, which its hooks then take.
  • Shared resources of a router: backends_loop is the loop its inner filesystems run on, where a router closes what they share, e.g. a credential.
  • Routers without a root: a router whose every path names its storage, e.g. by a URL naming an account, needs no _roots.
  • The license with the copy: the command line copies the package's LICENSE with the code, as the Apache License asks.

Changes

  • Profile methods take paths: _get_storage_profile(path) takes the operation's path, or paths, tried in turn until one loads. _load_storage_profile(path) takes one.
  • No profile required: storage_profile is a class field, UNKNOWN by default, and holds the profile once loaded. A filesystem need not set it.
  • Inner filesystems in the router's mode: make them with the router's asynchronous and loop. Made async under a sync router, their sync methods, such as open and sign, had no loop to run on.

Documentation:

Install

Upgrade the interface:

pip install -U fsspec-alt-strategies

Copy the strategies again over your copy, and keep its LICENSE:

uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategy

Then, in your filesystems:

  • give _load_storage_profile and _get_storage_profile a path, where you override or call them;
  • drop a storage_profile set only to satisfy the check at construction: UNKNOWN is the default;
  • in a router, make inner filesystems with asynchronous=self.asynchronous and loop=self.loop.

What's Changed

  • 0.4.0: storage profiles loaded with the operation's paths, a generic router, the copy's LICENSE by @sugibuchi in #7

Full Changelog: v0.3.0...v0.4.0

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Nov 16:09
v0.3.0
5a71f3d

Faster listings of large trees, and wrappers of s3fs, gcsfs and adlfs of their own, with breaking changes. The library is still in alpha.

New

  • Whole trees in one listing: a tree storage with a recursive listing, such as Azure Data Lake Storage Gen2, lists a whole tree in one paginated request. On Azure, a find of 340 directories took 1 request instead of 342.
  • Wrappers of s3fs, gcsfs and adlfs: monitored() wraps each with a wrapper of its own, using what the library has beyond fsspec's API:
    • S3fsWrapper streams its listing narrowed to a prefix, and copies a file without asking its size first;
    • GcsfsWrapper lists by a prefix, and deletes up to 100 objects per batch request;
    • AdlfsWrapper lists a tree in one request, and deletes the directories of a hierarchical namespace.
  • Your own wrapper by name: a known implementation's wrapper names a built-in wrapper, e.g. "S3fsWrapper", or a class of your own by its full name.
  • Directories renamed whole: _mv_tree, declared by renames_directories, moves a directory in one request where the storage can.
  • Fewer requests for ranges: cat_ranges fetches nearby ranges of a file in one request, and a large one in parallel parts. The router gives each storage its ranges in one call.

Changes

  • Flat listing by prefix: FlatFileSystem's _iexpand is replaced by _ils(path, recursive=False, prefix="").
  • Tree listing without a recursive one: _ils_by_directory is gone. A storage with no recursive listing returns _tree_ils(self, path, recursive=False, **kwargs) from its recursive _ils.
  • Wrappers in a package: wrapper.py is now wrapper/. Import AsyncTreeWrapper from wrapper.tree, and AsyncFlatWrapper from wrapper.flat.
  • Buckets on flat filesystems: FlatFileSystem requires _rmdir and _makedirs, as fsspec's defaults silently do nothing.
  • Partial batch deletes: _rm_files may return the keys it could not delete, each with its error. The others count as deleted. Returning None still says all were.
  • Bounded fan-out: fsspec's methods on many paths, such as cat, pipe, get and put, handle io_concurrency paths at a time, unless given a batch_size.
  • Reads and writes: random reads fetch blocks from 64 KiB, and a file closed before any part was sent goes in one request when it is a single part.

Fixes

  • adlfs directories: a recursive rm left the directories of an account with a hierarchical namespace.
  • gcsfs batches: gcsfs 2026 deleted 20 objects per batch request, and on a bucket with a hierarchical namespace asked each object's info first.

Documentation:

Install

Upgrade the interface:

pip install -U fsspec-alt-strategies

Copy the strategies again over your copy:

uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategy

Then, in your filesystems:

  • replace _iexpand with _ils(path, recursive=True, prefix=...), and _ils_by_directory with _tree_ils;
  • implement _rmdir and _makedirs on a FlatFileSystem;
  • import the wrappers from their modules under wrapper/.

What's Changed

  • 0.3.0: streaming listings, wrappers of s3fs, gcsfs and adlfs, per-key batch failures by @sugibuchi in #6

Full Changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 12:13
v0.2.0
27036b6

A simpler API, with breaking changes. The library is still in alpha.

Changes

  • Directories, not folders: every name says "directory", as fsspec does. For example, renames_folders is now renames_directories.
  • One storage profile per filesystem: set storage_profile, or override _load_storage_profile() when a request must find it. The filesystem loads it once and keeps it.
  • Storages that differ by path: the per-path profile hooks are gone. A storage that behaves differently per bucket or container is several filesystems under the router.
  • Recursive deletes declared: the new StorageProfile.deletes_directories says that a storage deletes a directory with all in it. _rm_tree is used only when it is declared.
  • No native: it is removed from the wrappers, monitored() and the known implementations.
  • Adaptive writable files: AdaptiveWritableFile takes a mode, wb or xb. It promises no atomic write: that is up to the storage.
  • Router copies and moves: _cross_fs_cp and _cross_fs_mv are async, and take maxdepth.
  • Moves make their parent: a move creates the parent of a rename's destination itself.
  • Every change is watched: a recursive delete or a whole-directory rename shows in a monitor, and stops, like any other operation.
  • Aborted uploads: an aborted multipart upload is cleaned up where the storage offers a way. Otherwise the storage cleans it up.
  • Event loops: file adapters no longer check the running loop. A filesystem instance belongs to one event loop, as fsspec caches it.

Documentation:

Install

Upgrade the interface:

pip install -U fsspec-alt-strategies

Copy the strategies again over your copy:

uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategy

Then rename "folder" to "directory" in your code, and remove native.

What's Changed

  • Release notes: their style, rewritten after each release by @sugibuchi in #4
  • Release 0.2: one profile per filesystem, directories, simpler API by @sugibuchi in #5

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 17:59
v0.1.0
2283691

The first release: alternative, filesystem-independent strategies for fsspec filesystems, and a way to watch and stop what they do. The API may change while the library is in alpha.

New

  • File tree operations: walk, find, du, glob, and recursive delete, copy and move, in two families. tree suits storages with a hierarchical namespace, such as Azure Data Lake Storage Gen2, SFTP or HDFS. flat suits object stores, such as S3.
  • Streaming through large trees: a delete, copy or move acts on files as they are listed. A folder of hundreds of thousands of files is never held whole in memory.
  • Three ways to use them: call a strategy as a function, subclass TreeFileSystem or FlatFileSystem, or wrap an existing fsspec filesystem with monitored().
  • Storage profiles: a StorageProfile declares what a storage does that fsspec leaves open, so that the strategies send fewer requests.
  • Monitors: the real-time progress of the operations behind fsspec's methods, such as fs.rm(path, recursive=True), file by file, with each error, and a way to cancel.
  • Adaptive files: file objects for storages with range reads and multipart uploads, fast for both random and sequential access without tuning.
  • File adapters and transactions: SyncFileAdapter gives a sync file, such as an SDK's, the API of open_async. TransactionFile adds fsspec's transactions to an existing file object.
  • Filesystem router: AsyncRoutingFileSystem spans several storages, and copies or moves files between them.
  • Copy command: fsspec-alt-strategies-impl copy copies the strategies into your package, with their version.

Documentation:

Install

The interface is installed:

pip install fsspec-alt-strategies

The strategies are meant to be copied into your package, e.g. as _contrib/strategy:

uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategy

They can also be installed with pip install fsspec-alt-strategies-impl. Both packages need Python 3.11 or later, and fsspec 2024.2.0 or later.

What's Changed

New Contributors

Full Changelog: https://github.com/sugibuchi/fsspec-alt-strategies/commits/v0.1.0