Skip to main content

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:

Metadata

Release files for shellfs 0.2.0

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

Source distribution (sdist)

Source distribution for shellfs 0.2.0
File Size Uploaded
shellfs-0.2.0.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shellfs 0.2.0
File Interpreter ABI Platform
shellfs-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.3 kB

Release files / shellfs-0.2.0.tar.gz

Download URL shellfs-0.2.0.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3f6b200c44d26bb378fa231b15ce40e708ffd776dbb14460c692573a79d49a37
BLAKE2b-256 checksum
How to use checksums
d1eb9f5f2c759f38c850f8607dd40ab625b6213a8e5d6f616444c0a4e53aa25e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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 Oct 31, 2024.

Transparency log

Release files / shellfs-0.2.0-py3-none-any.whl

Download URL shellfs-0.2.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bf777f8ce2edf4b523fc2d5cd172b83572c0d09131efb6afd45c7458e2369b8
BLAKE2b-256 checksum
How to use checksums
3eae0057a9fb14893d01ac7029f15d738ada2567244e4541c740dfc161584859
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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 Oct 31, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

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