Provides a filesystem abstraction based on shell commands
Project description
shellfs
shellfs is a simple, in-performant filesystem that uses shell commands to implement filesystem operations. shellfs is based on fsspec that provides the core functionality for different filesystems.
shellfs provides:
- a filesystem abstraction if a shell is provided to run commands
- the shell protocol provides a stable interface to run commands in any shell
- a
ShellProtocol
as extension-point for different kind of shells (to execute filesystem operation commands). - a
FileSystemProtocol
as extension-point to execute filesystem operations via shell commands, - a
FSOperationCommand
as low-level profile that acts as adapter. between different shell command dialects and supports the shell command execution. - the shell protocol is implemented for the local shell (on Unix platforms).
EXAMPLE:
# -- FILE: example_use_shellfs.py
# SHELL PROVIDES:
# * run(command, ...) method to execute commands (filesystem operations)
# * FSOPS_COMMAND_CLASS: Provides low-level functionality for FileSystemProtocol
from shellfs import ShellFileSystem
from shellfs.shell.unix import UnixShell
from pathlib import Path
this_shell = UnixShell()
shellfs = ShellFileSystem(this_shell)
some_dir_path = "/tmp/some_dir"
some_file_path = Path(some_dir_path)/"some_file.txt"
shellfs.touch(some_file_path)
assert shellfs.exists(some_file_path) is True
assert shellfs.isfile(some_file_path) is True
assert shellfs.isdir(some_file_path) is False
assert shellfs.isdir(some_dir_path) is True
NOTES:
- The shellfs is not very performant.
- The shellfs is intended to be used if no better filesystem exists and only if a command shell is provided that allows to access the internal filesystem.
RELATED:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file shellfs-0.2.0.tar.gz
.
File metadata
- Download URL: shellfs-0.2.0.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f6b200c44d26bb378fa231b15ce40e708ffd776dbb14460c692573a79d49a37 |
|
MD5 | 78f946771e3978cb1a1e5be400877140 |
|
BLAKE2b-256 | d1eb9f5f2c759f38c850f8607dd40ab625b6213a8e5d6f616444c0a4e53aa25e |
Provenance
The following attestation bundles were made for shellfs-0.2.0.tar.gz
:
Publisher:
release-to-pypi.yml
on jenisys/shellfs
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
shellfs-0.2.0.tar.gz
- Subject digest:
3f6b200c44d26bb378fa231b15ce40e708ffd776dbb14460c692573a79d49a37
- Sigstore transparency entry: 145471523
- Sigstore integration time:
- Predicate type:
File details
Details for the file shellfs-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: shellfs-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bf777f8ce2edf4b523fc2d5cd172b83572c0d09131efb6afd45c7458e2369b8 |
|
MD5 | e14838e161d575649c43ee5abd4ee0b8 |
|
BLAKE2b-256 | 3eae0057a9fb14893d01ac7029f15d738ada2567244e4541c740dfc161584859 |
Provenance
The following attestation bundles were made for shellfs-0.2.0-py3-none-any.whl
:
Publisher:
release-to-pypi.yml
on jenisys/shellfs
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
shellfs-0.2.0-py3-none-any.whl
- Subject digest:
7bf777f8ce2edf4b523fc2d5cd172b83572c0d09131efb6afd45c7458e2369b8
- Sigstore transparency entry: 145471525
- Sigstore integration time:
- Predicate type: