Python SDK for the AFS control plane and agent filesystem mounts.
Project description
redis-afs
Python SDK for creating AFS workspaces, mounting them in-process, reading and writing files, checkpointing work, and running shell commands against an isolated AFS-backed workspace.
Install
pip install redis-afs
Quick Start
import os
from redis_afs import AFS
afs = AFS(api_key=os.environ["AFS_API_KEY"])
workspace = afs.workspace.create(name="foobar")
fs = afs.fs.mount(
workspaces=[{"name": workspace["name"]}],
mode="rw",
)
try:
fs.write_file("/src/README.md", "hello world")
result = fs.bash().exec("cat /foobar/src/README.md")
print(result.stdout)
finally:
fs.close()
MountedFS also works as a context manager:
with afs.fs.mount(workspaces=[{"name": "foobar"}], mode="rw") as fs:
fs.write_file("/README.md", "hello")
Authentication
export AFS_API_KEY="afs_..."
Set AFS_API_BASE_URL to target a local or Self-managed control plane. If not
provided, the SDK defaults to https://afs.cloud.
API Reference
See api-docs.md for the full Python API surface, including workspace management, checkpoints, mount semantics, file operations, shell execution, low-level MCP access, and current limitations.
Test
From sdk/python:
PYTHONPATH=src python3 -m unittest discover -s tests
From the project root:
PYTHONPATH=sdk/python/src python3 -m unittest discover -s sdk/python/tests
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 redis_afs-0.1.0.tar.gz.
File metadata
- Download URL: redis_afs-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2b523b80a23f5cc853d6e971e213a00490d133114debd02926f0c0eaa3ef778
|
|
| MD5 |
c4d6e2e949c4fbd1f9f0bc499d53edf6
|
|
| BLAKE2b-256 |
f8cb1006c633dac823a22040537c84eb49da3474ac28b636a3877ea754f15cf4
|
Provenance
The following attestation bundles were made for redis_afs-0.1.0.tar.gz:
Publisher:
python-sdk.yml on redis/agent-filesystem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_afs-0.1.0.tar.gz -
Subject digest:
a2b523b80a23f5cc853d6e971e213a00490d133114debd02926f0c0eaa3ef778 - Sigstore transparency entry: 1406808957
- Sigstore integration time:
-
Permalink:
redis/agent-filesystem@3242adcbeb068735ce97bda009508112fdc49904 -
Branch / Tag:
refs/tags/redis-afs-python-v0.1.0 - Owner: https://github.com/redis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk.yml@3242adcbeb068735ce97bda009508112fdc49904 -
Trigger Event:
push
-
Statement type:
File details
Details for the file redis_afs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: redis_afs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 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 |
1ba4756f4f04920950e40804861f7c721f44f4bebcb60aec39a350070ca10464
|
|
| MD5 |
c2df55b2ad30fc6773e48e67f9bb7762
|
|
| BLAKE2b-256 |
d3aca787b692f5a2e4d6b80b9b2565be8340ce90259dacae3dbeab4d1b97abbf
|
Provenance
The following attestation bundles were made for redis_afs-0.1.0-py3-none-any.whl:
Publisher:
python-sdk.yml on redis/agent-filesystem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_afs-0.1.0-py3-none-any.whl -
Subject digest:
1ba4756f4f04920950e40804861f7c721f44f4bebcb60aec39a350070ca10464 - Sigstore transparency entry: 1406809022
- Sigstore integration time:
-
Permalink:
redis/agent-filesystem@3242adcbeb068735ce97bda009508112fdc49904 -
Branch / Tag:
refs/tags/redis-afs-python-v0.1.0 - Owner: https://github.com/redis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk.yml@3242adcbeb068735ce97bda009508112fdc49904 -
Trigger Event:
push
-
Statement type: