rclone-python is a Python wrapper for the powerful rclone command-line tool, enabling programmatic interaction with various cloud storage providers. It provides a Pythonic interface for operations like copying, moving, syncing, listing, and managing files and remotes. The library is actively maintained, currently at version 0.1.24, and receives regular updates, often with minor bug fixes and feature enhancements.
pip install rclone-pythonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use the `rclone_python` library. It includes checking for the rclone binary, performing a simple file copy operation, and listing the contents of a directory. It also shows basic error handling for `RcloneException`.
Install the rclone CLI tool according to its official documentation (https://rclone.org/install/) for your operating system.
Update your code to include `try...except rclone.RcloneException as e:` blocks for robust error handling. The exception object contains `output` (a dictionary) and `status` (an integer) attributes for detailed error information.
Utilize the support for custom rclone config paths introduced in v0.1.22. You can specify the `--config` flag via `extra_args` or investigate if the wrapper offers a direct parameter for it. Alternatively, set the `RCLONE_CONFIG` environment variable to point to your desired configuration file.
Upgrade to `rclone-python` v0.1.20 or later. This version fixed the redirection issue, ensuring logs are routed appropriately. If on older versions, be mindful when parsing `stderr` output.
Install the `rclone` CLI tool from its official website (https://rclone.org/install/) and ensure its executable is in a directory listed in your system's PATH. On Linux/macOS, this often means placing it in `/usr/local/bin`.
Verify that the `rclone.conf` file exists at the expected location (default is `~/.config/rclone/rclone.conf` on Linux/macOS, or `%APPDATA%\rclone\rclone.conf` on Windows), and that your Python process has read/write permissions. If running multiple rclone instances, ensure they don't contend for the same config file. Consider using `rclone.with_config()` for in-memory configuration or a custom config path (v0.1.22+).
Double-check the source and destination paths, including remote names (e.g., `remote_name:path/to/file`). Ensure the remote is correctly configured and accessible. Verify that the specified source file or directory actually exists on the remote or local filesystem.
Upgrade `rclone-python` to version 0.1.23 or newer. This version specifically addresses the bug where empty error messages were returned during failed transfer operations, providing more actionable feedback.
No dependency data recorded yet.