Skip to main content

A Python client for JuiceFS operations

Project description

JuiceFS Client

A Python client for JuiceFS operations with easy-to-use interfaces and AWS credentials support.

Installation

pip install juicefs-client

Quick Start

Initialize Client

from juicefs_client import JuiceFSClient

# Using environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
client = JuiceFSClient(volume="myvolume", token="mytoken")

# Or with explicit credentials
client = JuiceFSClient(
    volume="myvolume",
    token="mytoken",
    access_key="your-aws-access-key",
    secret_key="your-aws-secret-key"
)

Basic File Operations

# Write and read text files
client.write_file("/path/to/file.txt", "Hello World")
content = client.read_file("/path/to/file.txt")

# Binary files (e.g., PyTorch models)
client.save_torch_model("/models/model.pt", model.state_dict())
state_dict = client.load_torch_model("/models/model.pt")

# List directory contents
files = client.list_dir("/path/to/directory")

# Delete files
client.delete_file("/path/to/file.txt")

# Copy files
client.copy_file("/source/path", "/destination/path")

Features

  • Simple and intuitive API for JuiceFS operations
  • AWS credentials support (both environment variables and explicit)
  • Built-in support for PyTorch model serialization
  • File operations: read, write, delete, copy, list
  • Directory operations: create, list, delete

Configuration

Parameter Description Required Default
volume JuiceFS volume name Yes None
token Authentication token Yes None
access_key AWS access key No None
secret_key AWS secret key No None
endpoint Custom endpoint URL No None
region AWS region No 'us-east-1'

Error Handling

from juicefs_client.exceptions import JuiceFSError

try:
    client.read_file("/nonexistent/file.txt")
except JuiceFSError as e:
    print(f"Error: {e}")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

juicefs_client-0.1.5.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

juicefs_client-0.1.5-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file juicefs_client-0.1.5.tar.gz.

File metadata

  • Download URL: juicefs_client-0.1.5.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for juicefs_client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f98f6e5bd71cb9f255b6dbc557b646202b2de8aad2e9af65c9b3cedded7a52aa
MD5 88fd68ae5fedd1a3ef8958d544cd0cfb
BLAKE2b-256 50df93938591ec90427b16cb3eb4a01212890378ed63aa00038db29b1ff6687d

See more details on using hashes here.

File details

Details for the file juicefs_client-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: juicefs_client-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for juicefs_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5f1d0ab35416deb1721d74c209239e50309becd410a9202c5bf0ef2422aba9e4
MD5 f3e765ddccc09144281da5251bd895ac
BLAKE2b-256 1677695a09757946e8d2431d58d4a51e29b7ea57e154c390715bf9b12ee65f0b

See more details on using hashes here.

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