Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redis_afs-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redis_afs-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for redis_afs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2b523b80a23f5cc853d6e971e213a00490d133114debd02926f0c0eaa3ef778
MD5 c4d6e2e949c4fbd1f9f0bc499d53edf6
BLAKE2b-256 f8cb1006c633dac823a22040537c84eb49da3474ac28b636a3877ea754f15cf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for redis_afs-0.1.0.tar.gz:

Publisher: python-sdk.yml on redis/agent-filesystem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for redis_afs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ba4756f4f04920950e40804861f7c721f44f4bebcb60aec39a350070ca10464
MD5 c2df55b2ad30fc6773e48e67f9bb7762
BLAKE2b-256 d3aca787b692f5a2e4d6b80b9b2565be8340ce90259dacae3dbeab4d1b97abbf

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page