Repository navigation
Releases
v0.4.1
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-impl0.4.0 accepted any interface from 0.1, but needs 0.4's, e.g. itsUNKNOWN. Installed beside an older interface, it failed on import. 0.4.1 requiresfsspec-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-implA 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
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_loopis 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
LICENSEwith 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_profileis a class field,UNKNOWNby 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
asynchronousandloop. Made async under a sync router, their sync methods, such asopenandsign, had no loop to run on.
Documentation:
Install
Upgrade the interface:
pip install -U fsspec-alt-strategiesCopy 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/strategyThen, in your filesystems:
- give
_load_storage_profileand_get_storage_profilea path, where you override or call them; - drop a
storage_profileset only to satisfy the check at construction:UNKNOWNis the default; - in a router, make inner filesystems with
asynchronous=self.asynchronousandloop=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
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:S3fsWrapperstreams its listing narrowed to a prefix, and copies a file without asking its size first;GcsfsWrapperlists by a prefix, and deletes up to 100 objects per batch request;AdlfsWrapperlists a tree in one request, and deletes the directories of a hierarchical namespace.
- Your own wrapper by name: a known implementation's
wrappernames a built-in wrapper, e.g."S3fsWrapper", or a class of your own by its full name. - Directories renamed whole:
_mv_tree, declared byrenames_directories, moves a directory in one request where the storage can. - Fewer requests for ranges:
cat_rangesfetches 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_iexpandis replaced by_ils(path, recursive=False, prefix=""). - Tree listing without a recursive one:
_ils_by_directoryis gone. A storage with no recursive listing returns_tree_ils(self, path, recursive=False, **kwargs)from its recursive_ils. - Wrappers in a package:
wrapper.pyis nowwrapper/. ImportAsyncTreeWrapperfromwrapper.tree, andAsyncFlatWrapperfromwrapper.flat. - Buckets on flat filesystems:
FlatFileSystemrequires_rmdirand_makedirs, as fsspec's defaults silently do nothing. - Partial batch deletes:
_rm_filesmay 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,getandput, handleio_concurrencypaths at a time, unless given abatch_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
rmleft 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-strategiesCopy the strategies again over your copy:
uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategyThen, in your filesystems:
- replace
_iexpandwith_ils(path, recursive=True, prefix=...), and_ils_by_directorywith_tree_ils; - implement
_rmdirand_makedirson aFlatFileSystem; - 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
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_foldersis nowrenames_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_directoriessays that a storage deletes a directory with all in it._rm_treeis used only when it is declared. - No
native: it is removed from the wrappers,monitored()and the known implementations. - Adaptive writable files:
AdaptiveWritableFiletakes a mode,wborxb. It promises no atomic write: that is up to the storage. - Router copies and moves:
_cross_fs_cpand_cross_fs_mvare async, and takemaxdepth. - 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-strategiesCopy the strategies again over your copy:
uv run --with "fsspec-alt-strategies-impl[cli]" fsspec-alt-strategies-impl copy src/mypkg/_contrib/strategyThen 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
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.
treesuits storages with a hierarchical namespace, such as Azure Data Lake Storage Gen2, SFTP or HDFS.flatsuits 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
TreeFileSystemorFlatFileSystem, or wrap an existing fsspec filesystem withmonitored(). - Storage profiles: a
StorageProfiledeclares 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:
SyncFileAdaptergives a sync file, such as an SDK's, the API ofopen_async.TransactionFileadds fsspec's transactions to an existing file object. - Filesystem router:
AsyncRoutingFileSystemspans several storages, and copies or moves files between them. - Copy command:
fsspec-alt-strategies-impl copycopies the strategies into your package, with their version.
Documentation:
Install
The interface is installed:
pip install fsspec-alt-strategiesThe 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/strategyThey 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
- First release of fsspec-alt-strategies by @sugibuchi in #2
- Package metadata for the first release by @sugibuchi in #3
New Contributors
- @sugibuchi made their first contribution in #2
Full Changelog: https://github.com/sugibuchi/fsspec-alt-strategies/commits/v0.1.0