juicefs-client


Namejuicefs-client JSON
Version 0.1.12 PyPI version JSON
download
home_pagehttps://github.com/yourusername/juicefs-client
SummaryA Python client for JuiceFS operations
upload_time2024-11-12 10:13:36
maintainerNone
docs_urlNone
authorLuke
requires_python>=3.7
licenseMIT License Copyright (c) 2024 Jinyuan Lu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords juicefs storage cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # JuiceFS Client

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

## Installation

```bash
pip install juicefs-client
```

## Quick Start

### Initialize Client

```python
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

```python
# 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

```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/juicefs-client",
    "name": "juicefs-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "juicefs, storage, cloud",
    "author": "Luke",
    "author_email": "Luke <pypi@luke.archi>",
    "download_url": "https://files.pythonhosted.org/packages/3b/b4/f692105f2555b5f840569c2d1e453f88ff18a32bdaa12b1c1e084bf9b335/juicefs_client-0.1.12.tar.gz",
    "platform": null,
    "description": "# JuiceFS Client\n\nA Python client for JuiceFS operations with easy-to-use interfaces and AWS credentials support.\n\n## Installation\n\n```bash\npip install juicefs-client\n```\n\n## Quick Start\n\n### Initialize Client\n\n```python\nfrom juicefs_client import JuiceFSClient\n\n# Using environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)\nclient = JuiceFSClient(volume=\"myvolume\", token=\"mytoken\")\n\n# Or with explicit credentials\nclient = JuiceFSClient(\n    volume=\"myvolume\",\n    token=\"mytoken\",\n    access_key=\"your-aws-access-key\",\n    secret_key=\"your-aws-secret-key\"\n)\n```\n\n### Basic File Operations\n\n```python\n# Write and read text files\nclient.write_file(\"/path/to/file.txt\", \"Hello World\")\ncontent = client.read_file(\"/path/to/file.txt\")\n\n# Binary files (e.g., PyTorch models)\nclient.save_torch_model(\"/models/model.pt\", model.state_dict())\nstate_dict = client.load_torch_model(\"/models/model.pt\")\n\n# List directory contents\nfiles = client.list_dir(\"/path/to/directory\")\n\n# Delete files\nclient.delete_file(\"/path/to/file.txt\")\n\n# Copy files\nclient.copy_file(\"/source/path\", \"/destination/path\")\n```\n\n## Features\n\n- Simple and intuitive API for JuiceFS operations\n- AWS credentials support (both environment variables and explicit)\n- Built-in support for PyTorch model serialization\n- File operations: read, write, delete, copy, list\n- Directory operations: create, list, delete\n\n## Configuration\n\n| Parameter | Description | Required | Default |\n|-----------|-------------|----------|----------|\n| volume | JuiceFS volume name | Yes | None |\n| token | Authentication token | Yes | None |\n| access_key | AWS access key | No | None |\n| secret_key | AWS secret key | No | None |\n| endpoint | Custom endpoint URL | No | None |\n| region | AWS region | No | 'us-east-1' |\n\n## Error Handling\n\n```python\nfrom juicefs_client.exceptions import JuiceFSError\n\ntry:\n    client.read_file(\"/nonexistent/file.txt\")\nexcept JuiceFSError as e:\n    print(f\"Error: {e}\")\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Jinyuan Lu  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A Python client for JuiceFS operations",
    "version": "0.1.12",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/juicefs-client"
    },
    "split_keywords": [
        "juicefs",
        " storage",
        " cloud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa44b35198b97aaa63cc03c864ad72152e1db32a4e917b0a8eb10ebf927b22cf",
                "md5": "036e5ee8c4faa76030338e572af209f1",
                "sha256": "c42f2375c0c41204d6da43349b5a83d5e92fde87f163974255636b2e4d558d3b"
            },
            "downloads": -1,
            "filename": "juicefs_client-0.1.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "036e5ee8c4faa76030338e572af209f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8638,
            "upload_time": "2024-11-12T10:13:35",
            "upload_time_iso_8601": "2024-11-12T10:13:35.925823Z",
            "url": "https://files.pythonhosted.org/packages/fa/44/b35198b97aaa63cc03c864ad72152e1db32a4e917b0a8eb10ebf927b22cf/juicefs_client-0.1.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bb4f692105f2555b5f840569c2d1e453f88ff18a32bdaa12b1c1e084bf9b335",
                "md5": "26ca85c92f7433d44f04fbe8b1321ffb",
                "sha256": "57fbe74ec38b0317bfd9b5d47e8f7a2e9ca5f9bed01ddbafc7924d5d1de966a5"
            },
            "downloads": -1,
            "filename": "juicefs_client-0.1.12.tar.gz",
            "has_sig": false,
            "md5_digest": "26ca85c92f7433d44f04fbe8b1321ffb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9590,
            "upload_time": "2024-11-12T10:13:36",
            "upload_time_iso_8601": "2024-11-12T10:13:36.936459Z",
            "url": "https://files.pythonhosted.org/packages/3b/b4/f692105f2555b5f840569c2d1e453f88ff18a32bdaa12b1c1e084bf9b335/juicefs_client-0.1.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-12 10:13:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "juicefs-client",
    "github_not_found": true,
    "lcname": "juicefs-client"
}
        
Elapsed time: 0.35271s