Python virtual filesystem with structured state backend
Project description
py_fs_shell
Python virtual filesystem primitives for agent workflows, tests, and sandboxed file operations.
It provides:
InMemoryFsfor ephemeral virtual filesystemsLocalFileSystemfor sandboxed real-disk accessWorkspacefor metadata + blob backed storageFileSystemStateBackendfor JSON, search/replace, diffs, archives, hashing, and edit planning
Installation
With uv:
uv add py-fs-shell
With pip:
pip install py-fs-shell
For S3-backed workspaces:
uv add 'py-fs-shell[s3]'
pip install 'py-fs-shell[s3]'
For local development from this repository:
uv sync --extra dev --extra s3
Example
import asyncio
from py_fs_shell import StateWriteEditInstruction, workspace
async def main():
ws = await workspace.memory()
state = ws.state()
await state.write_file("/src/main.py", "print('hello world')\n")
await state.write_json("/config.json", {"debug": True})
matches = await state.search_files("**/*.py", "hello")
print(matches[0].path)
plan = await state.plan_edits([
StateWriteEditInstruction(
path="/README.md",
content="# Demo\n",
),
])
await state.apply_edit_plan(plan)
await state.write_file_bytes("/video.mp4", b"video bytes")
asyncio.run(main())
S3-backed workspace:
from py_fs_shell import workspace
ws = await workspace.s3(bucket="my-bucket", prefix="runs/123")
state = ws.state()
Releases
Releases are tracked with semversioner. See RELEASE.md and CHANGELOG.md.
License
MIT. See LICENSE.
Inspired by Cloudflare's @cloudflare/shell package.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_fs_shell-0.0.2.tar.gz.
File metadata
- Download URL: py_fs_shell-0.0.2.tar.gz
- Upload date:
- Size: 74.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d113acc4b5c54d9021bf96d83d79941536bbcc8d60e131f54df35bb5dd1851a7
|
|
| MD5 |
8584fcf1e15ab884912c9e7ba28629d7
|
|
| BLAKE2b-256 |
938bb6b0e5828720192905b475720bbf04fa8cae3c92744356c1b1ead2b9be99
|
Provenance
The following attestation bundles were made for py_fs_shell-0.0.2.tar.gz:
Publisher:
release.yml on Abdulmumin1/py-fs-shell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_fs_shell-0.0.2.tar.gz -
Subject digest:
d113acc4b5c54d9021bf96d83d79941536bbcc8d60e131f54df35bb5dd1851a7 - Sigstore transparency entry: 1428998054
- Sigstore integration time:
-
Permalink:
Abdulmumin1/py-fs-shell@a4634b2dd653185cd8d89fe0174a072fbe980199 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Abdulmumin1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a4634b2dd653185cd8d89fe0174a072fbe980199 -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_fs_shell-0.0.2-py3-none-any.whl.
File metadata
- Download URL: py_fs_shell-0.0.2-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f783fd6a212474131649ad79a4ac770e020c872cb29b204c03ec16b0fa920021
|
|
| MD5 |
417a3c53fc4772aee777b222fd3561a0
|
|
| BLAKE2b-256 |
8e9e7f44a111182c76f8e7d7f8c8377e64eb437c5f166809a61f715edff1e794
|
Provenance
The following attestation bundles were made for py_fs_shell-0.0.2-py3-none-any.whl:
Publisher:
release.yml on Abdulmumin1/py-fs-shell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_fs_shell-0.0.2-py3-none-any.whl -
Subject digest:
f783fd6a212474131649ad79a4ac770e020c872cb29b204c03ec16b0fa920021 - Sigstore transparency entry: 1428998057
- Sigstore integration time:
-
Permalink:
Abdulmumin1/py-fs-shell@a4634b2dd653185cd8d89fe0174a072fbe980199 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Abdulmumin1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a4634b2dd653185cd8d89fe0174a072fbe980199 -
Trigger Event:
push
-
Statement type: