rclone-api 1.5.3__py2.py3-none-any.whl → 1.5.5__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rclone_api/__init__.py CHANGED
@@ -190,7 +190,7 @@ class Rclone:
190
190
 
191
191
  def ls_stream(
192
192
  self,
193
- path: str,
193
+ src: str,
194
194
  max_depth: int = -1,
195
195
  fast_list: bool = False,
196
196
  ) -> FilesStream:
@@ -201,14 +201,14 @@ class Rclone:
201
201
  results incrementally rather than collecting them all at once.
202
202
 
203
203
  Args:
204
- path: Remote path to list
204
+ src: Remote path to list
205
205
  max_depth: Maximum recursion depth (-1 for unlimited)
206
206
  fast_list: Use fast list (only recommended for listing entire repositories or small datasets)
207
207
 
208
208
  Returns:
209
209
  A stream of file entries that can be iterated over
210
210
  """
211
- return self.impl.ls_stream(path=path, max_depth=max_depth, fast_list=fast_list)
211
+ return self.impl.ls_stream(src=src, max_depth=max_depth, fast_list=fast_list)
212
212
 
213
213
  def save_to_db(
214
214
  self,
@@ -235,7 +235,7 @@ class Rclone:
235
235
 
236
236
  def ls(
237
237
  self,
238
- path: Dir | Remote | str | None = None,
238
+ src: Dir | Remote | str | None = None,
239
239
  max_depth: int | None = None,
240
240
  glob: str | None = None,
241
241
  order: Order = Order.NORMAL,
@@ -247,7 +247,7 @@ class Rclone:
247
247
  Provides a detailed listing with file metadata.
248
248
 
249
249
  Args:
250
- path: Path to list (Dir, Remote, or string path)
250
+ src: Path to list (Dir, Remote, or string path)
251
251
  max_depth: Maximum recursion depth (None for default)
252
252
  glob: Optional glob pattern to filter results
253
253
  order: Sorting order for the results
@@ -257,7 +257,7 @@ class Rclone:
257
257
  DirListing object containing the results
258
258
  """
259
259
  return self.impl.ls(
260
- path=path,
260
+ src=src,
261
261
  max_depth=max_depth,
262
262
  glob=glob,
263
263
  order=order,
@@ -325,7 +325,7 @@ class Rclone:
325
325
 
326
326
  def walk(
327
327
  self,
328
- path: Dir | Remote | str,
328
+ src: Dir | Remote | str,
329
329
  max_depth: int = -1,
330
330
  breadth_first: bool = True,
331
331
  order: Order = Order.NORMAL,
@@ -337,7 +337,7 @@ class Rclone:
337
337
  and yields their contents.
338
338
 
339
339
  Args:
340
- path: Remote path, Dir, or Remote object to walk through
340
+ src: Remote path, Dir, or Remote object to walk through
341
341
  max_depth: Maximum depth to traverse (-1 for unlimited)
342
342
  breadth_first: If True, use breadth-first traversal, otherwise depth-first
343
343
  order: Sorting order for directory entries
@@ -346,7 +346,7 @@ class Rclone:
346
346
  DirListing: Directory listing for each directory encountered
347
347
  """
348
348
  return self.impl.walk(
349
- path=path, max_depth=max_depth, breadth_first=breadth_first, order=order
349
+ src=src, max_depth=max_depth, breadth_first=breadth_first, order=order
350
350
  )
351
351
 
352
352
  def scan_missing_folders(
@@ -376,7 +376,7 @@ class Rclone:
376
376
  )
377
377
 
378
378
  def cleanup(
379
- self, path: str, other_args: list[str] | None = None
379
+ self, src: str, other_args: list[str] | None = None
380
380
  ) -> CompletedProcess:
381
381
  """
382
382
  Cleanup any resources used by the Rclone instance.
@@ -384,13 +384,13 @@ class Rclone:
384
384
  Removes temporary files and directories created by rclone.
385
385
 
386
386
  Args:
387
- path: Path to clean up
387
+ src: Path to clean up
388
388
  other_args: Additional command-line arguments
389
389
 
390
390
  Returns:
391
391
  CompletedProcess with the result of the cleanup operation
392
392
  """
393
- return self.impl.cleanup(path=path, other_args=other_args)
393
+ return self.impl.cleanup(src=src, other_args=other_args)
394
394
 
395
395
  def copy_to(
396
396
  self,
@@ -527,19 +527,19 @@ class Rclone:
527
527
  other_args=other_args,
528
528
  )
529
529
 
530
- def purge(self, path: Dir | str) -> CompletedProcess:
530
+ def purge(self, src: Dir | str) -> CompletedProcess:
531
531
  """
532
532
  Purge a directory.
533
533
 
534
534
  Removes a directory and all its contents.
535
535
 
536
536
  Args:
537
- path: Rclone style path
537
+ src: Rclone style path
538
538
 
539
539
  Returns:
540
540
  CompletedProcess with the result of the purge operation
541
541
  """
542
- return self.impl.purge(path=path)
542
+ return self.impl.purge(src=src)
543
543
 
544
544
  def delete_files(
545
545
  self,
@@ -573,17 +573,17 @@ class Rclone:
573
573
  other_args=other_args,
574
574
  )
575
575
 
576
- def exists(self, path: Dir | Remote | str | File) -> bool:
576
+ def exists(self, src: Dir | Remote | str | File) -> bool:
577
577
  """
578
578
  Check if a file or directory exists.
579
579
 
580
580
  Args:
581
- path: Path to check (Dir, Remote, File, or path string)
581
+ src: Path to check (Dir, Remote, File, or path string)
582
582
 
583
583
  Returns:
584
584
  True if the path exists, False otherwise
585
585
  """
586
- return self.impl.exists(path=path)
586
+ return self.impl.exists(src=src)
587
587
 
588
588
  def is_synced(self, src: str | Dir, dst: str | Dir) -> bool:
589
589
  """
@@ -794,6 +794,7 @@ class Rclone:
794
794
  src: Remote | Dir | str,
795
795
  outdir: Path,
796
796
  allow_writes: bool | None = False,
797
+ transfers: int | None = None, # number of writes to perform in parallel
797
798
  use_links: bool | None = None,
798
799
  vfs_cache_mode: str | None = None,
799
800
  verbose: bool | None = None,
@@ -811,6 +812,7 @@ class Rclone:
811
812
  src: Remote or directory to mount
812
813
  outdir: Local path to mount to
813
814
  allow_writes: Whether to allow write operations
815
+ transfers: Number of parallel write operations
814
816
  use_links: Whether to use symbolic links
815
817
  vfs_cache_mode: VFS cache mode (e.g., "full", "minimal")
816
818
  verbose: Whether to show detailed output
@@ -826,6 +828,7 @@ class Rclone:
826
828
  src=src,
827
829
  outdir=outdir,
828
830
  allow_writes=allow_writes,
831
+ transfers=transfers,
829
832
  use_links=use_links,
830
833
  vfs_cache_mode=vfs_cache_mode,
831
834
  verbose=verbose,
rclone_api/rclone_impl.py CHANGED
@@ -148,7 +148,7 @@ class RcloneImpl:
148
148
 
149
149
  def ls_stream(
150
150
  self,
151
- path: str,
151
+ src: str,
152
152
  max_depth: int = -1,
153
153
  fast_list: bool = False,
154
154
  ) -> FilesStream:
@@ -160,7 +160,7 @@ class RcloneImpl:
160
160
  max_depth: Maximum recursion depth (-1 for unlimited)
161
161
  fast_list: Use fast list (only use when getting THE entire data repository from the root/bucket, or it's small)
162
162
  """
163
- cmd = ["lsjson", path, "--files-only"]
163
+ cmd = ["lsjson", src, "--files-only"]
164
164
  recurse = max_depth < 0 or max_depth > 1
165
165
  if recurse:
166
166
  cmd.append("-R")
@@ -168,7 +168,7 @@ class RcloneImpl:
168
168
  cmd += ["--max-depth", str(max_depth)]
169
169
  if fast_list:
170
170
  cmd.append("--fast-list")
171
- streamer = FilesStream(path, self._launch_process(cmd, capture=True))
171
+ streamer = FilesStream(src, self._launch_process(cmd, capture=True))
172
172
  return streamer
173
173
 
174
174
  def save_to_db(
@@ -197,7 +197,7 @@ class RcloneImpl:
197
197
 
198
198
  def ls(
199
199
  self,
200
- path: Dir | Remote | str | None = None,
200
+ src: Dir | Remote | str | None = None,
201
201
  max_depth: int | None = None,
202
202
  glob: str | None = None,
203
203
  order: Order = Order.NORMAL,
@@ -206,14 +206,14 @@ class RcloneImpl:
206
206
  """List files in the given path.
207
207
 
208
208
  Args:
209
- path: Remote path or Remote object to list
209
+ src: Remote path or Remote object to list
210
210
  max_depth: Maximum recursion depth (0 means no recursion)
211
211
 
212
212
  Returns:
213
213
  List of File objects found at the path
214
214
  """
215
215
 
216
- if path is None:
216
+ if src is None:
217
217
  # list remotes instead
218
218
  list_remotes: list[Remote] = self.listremotes()
219
219
  dirs: list[Dir] = [Dir(remote) for remote in list_remotes]
@@ -222,9 +222,9 @@ class RcloneImpl:
222
222
  rpaths = [d.path for d in dirs]
223
223
  return DirListing(rpaths)
224
224
 
225
- if isinstance(path, str):
226
- path = Dir(
227
- to_path(path, self)
225
+ if isinstance(src, str):
226
+ src = Dir(
227
+ to_path(src, self)
228
228
  ) # assume it's a directory if ls is being called.
229
229
 
230
230
  cmd = ["lsjson"]
@@ -237,15 +237,15 @@ class RcloneImpl:
237
237
  if listing_option != ListingOption.ALL:
238
238
  cmd.append(f"--{listing_option.value}")
239
239
 
240
- cmd.append(str(path))
241
- remote = path.remote if isinstance(path, Dir) else path
240
+ cmd.append(str(src))
241
+ remote = src.remote if isinstance(src, Dir) else src
242
242
  assert isinstance(remote, Remote)
243
243
 
244
244
  cp = self._run(cmd, check=True)
245
245
  text = cp.stdout
246
246
  parent_path: str | None = None
247
- if isinstance(path, Dir):
248
- parent_path = path.path.path
247
+ if isinstance(src, Dir):
248
+ parent_path = src.path.path
249
249
  paths: list[RPath] = RPath.from_json_str(text, remote, parent_path=parent_path)
250
250
  # print(parent_path)
251
251
  for o in paths:
@@ -261,10 +261,10 @@ class RcloneImpl:
261
261
  random.shuffle(paths)
262
262
  return DirListing(paths)
263
263
 
264
- def print(self, path: str) -> Exception | None:
264
+ def print(self, src: str) -> Exception | None:
265
265
  """Print the contents of a file."""
266
266
  try:
267
- text_or_err = self.read_text(path)
267
+ text_or_err = self.read_text(src)
268
268
  if isinstance(text_or_err, Exception):
269
269
  return text_or_err
270
270
  print(text_or_err)
@@ -372,7 +372,7 @@ class RcloneImpl:
372
372
 
373
373
  def walk(
374
374
  self,
375
- path: Dir | Remote | str,
375
+ src: Dir | Remote | str,
376
376
  max_depth: int = -1,
377
377
  breadth_first: bool = True,
378
378
  order: Order = Order.NORMAL,
@@ -380,20 +380,20 @@ class RcloneImpl:
380
380
  """Walk through the given path recursively.
381
381
 
382
382
  Args:
383
- path: Remote path or Remote object to walk through
383
+ src: Remote path or Remote object to walk through
384
384
  max_depth: Maximum depth to traverse (-1 for unlimited)
385
385
 
386
386
  Yields:
387
387
  DirListing: Directory listing for each directory encountered
388
388
  """
389
389
  dir_obj: Dir
390
- if isinstance(path, Dir):
390
+ if isinstance(src, Dir):
391
391
  # Create a Remote object for the path
392
- remote = path.remote
392
+ remote = src.remote
393
393
  rpath = RPath(
394
394
  remote=remote,
395
- path=path.path.path,
396
- name=path.path.name,
395
+ path=src.path.path,
396
+ name=src.path.name,
397
397
  size=0,
398
398
  mime_type="inode/directory",
399
399
  mod_time="",
@@ -401,13 +401,13 @@ class RcloneImpl:
401
401
  )
402
402
  rpath.set_rclone(self)
403
403
  dir_obj = Dir(rpath)
404
- elif isinstance(path, str):
405
- dir_obj = Dir(to_path(path, self))
406
- elif isinstance(path, Remote):
407
- dir_obj = Dir(path)
404
+ elif isinstance(src, str):
405
+ dir_obj = Dir(to_path(src, self))
406
+ elif isinstance(src, Remote):
407
+ dir_obj = Dir(src)
408
408
  else:
409
- dir_obj = Dir(path) # shut up pyright
410
- assert f"Invalid type for path: {type(path)}"
409
+ dir_obj = Dir(src) # shut up pyright
410
+ assert f"Invalid type for path: {type(src)}"
411
411
 
412
412
  yield from walk(
413
413
  dir_obj, max_depth=max_depth, breadth_first=breadth_first, order=order
@@ -441,11 +441,11 @@ class RcloneImpl:
441
441
  )
442
442
 
443
443
  def cleanup(
444
- self, path: str, other_args: list[str] | None = None
444
+ self, src: str, other_args: list[str] | None = None
445
445
  ) -> CompletedProcess:
446
446
  """Cleanup any resources used by the Rclone instance."""
447
447
  # rclone cleanup remote:path [flags]
448
- cmd = ["cleanup", path]
448
+ cmd = ["cleanup", src]
449
449
  if other_args:
450
450
  cmd += other_args
451
451
  out = self._run(cmd)
@@ -670,11 +670,11 @@ class RcloneImpl:
670
670
  cp = self._run(cmd_list, check=check, capture=False)
671
671
  return CompletedProcess.from_subprocess(cp)
672
672
 
673
- def purge(self, path: Dir | str) -> CompletedProcess:
673
+ def purge(self, src: Dir | str) -> CompletedProcess:
674
674
  """Purge a directory"""
675
675
  # path should always be a string
676
- path = path if isinstance(path, str) else str(path.path)
677
- cmd_list: list[str] = ["purge", str(path)]
676
+ src = src if isinstance(src, str) else str(src.path)
677
+ cmd_list: list[str] = ["purge", str(src)]
678
678
  cp = self._run(cmd_list)
679
679
  return CompletedProcess.from_subprocess(cp)
680
680
 
@@ -761,9 +761,9 @@ class RcloneImpl:
761
761
  out = self.delete_files(files)
762
762
  return out
763
763
 
764
- def exists(self, path: Dir | Remote | str | File) -> bool:
764
+ def exists(self, src: Dir | Remote | str | File) -> bool:
765
765
  """Check if a file or directory exists."""
766
- arg: str = convert_to_str(path)
766
+ arg: str = convert_to_str(src)
767
767
  assert isinstance(arg, str)
768
768
  try:
769
769
  dir_listing = self.ls(arg)
@@ -996,6 +996,7 @@ class RcloneImpl:
996
996
  src: Remote | Dir | str,
997
997
  outdir: Path,
998
998
  allow_writes: bool | None = False,
999
+ transfers: int | None = None,
999
1000
  use_links: bool | None = None,
1000
1001
  vfs_cache_mode: str | None = None,
1001
1002
  verbose: bool | None = None,
@@ -1036,6 +1037,9 @@ class RcloneImpl:
1036
1037
  if cache_dir:
1037
1038
  cmd_list.append("--cache-dir")
1038
1039
  cmd_list.append(str(cache_dir.absolute()))
1040
+ if transfers is not None:
1041
+ cmd_list.append("--transfers")
1042
+ cmd_list.append(str(transfers))
1039
1043
  if debug_fuse:
1040
1044
  cmd_list.append("--debug-fuse")
1041
1045
  if verbose:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.5.3
3
+ Version: 1.5.5
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  License: BSD 3-Clause License
@@ -99,22 +99,43 @@ def test_ls_glob_png(self) -> None:
99
99
  ## API
100
100
 
101
101
  ```python
102
+
103
+ from rclone_api import Rclone
104
+
102
105
  class Rclone:
103
106
  """
104
107
  Main interface for interacting with Rclone.
105
-
108
+
106
109
  This class provides methods for all major Rclone operations including
107
110
  file transfers, listing, mounting, and remote management.
108
-
111
+
109
112
  It serves as the primary entry point for the API, wrapping the underlying
110
113
  implementation details and providing a clean, consistent interface.
111
114
  """
115
+
116
+ @staticmethod
117
+ def upgrade_rclone() -> Path:
118
+ """
119
+ Upgrade the rclone executable to the latest version.
120
+
121
+ Downloads the latest rclone binary and replaces the current one.
122
+
123
+ If an external rclone is already in your path then although upgrade_rclone
124
+ will download the latest version, it will not affect the rclone selected.
125
+
126
+ Returns:
127
+ Path to the upgraded rclone executable
128
+ """
129
+ from rclone_api.util import upgrade_rclone
130
+
131
+ return upgrade_rclone()
132
+
112
133
  def __init__(
113
134
  self, rclone_conf: Path | Config, rclone_exe: Path | None = None
114
135
  ) -> None:
115
136
  """
116
137
  Initialize the Rclone interface.
117
-
138
+
118
139
  Args:
119
140
  rclone_conf: Path to rclone config file or Config object
120
141
  rclone_exe: Optional path to rclone executable. If None, will search in PATH.
@@ -126,12 +147,12 @@ class Rclone:
126
147
  def webgui(self, other_args: list[str] | None = None) -> Process:
127
148
  """
128
149
  Launch the Rclone web GUI.
129
-
150
+
130
151
  Starts the built-in web interface for interacting with rclone.
131
-
152
+
132
153
  Args:
133
154
  other_args: Additional command-line arguments to pass to rclone
134
-
155
+
135
156
  Returns:
136
157
  Process object representing the running web GUI
137
158
  """
@@ -146,15 +167,15 @@ class Rclone:
146
167
  ) -> Process:
147
168
  """
148
169
  Launch the Rclone server so it can receive commands.
149
-
170
+
150
171
  Starts an rclone server that can be controlled remotely.
151
-
172
+
152
173
  Args:
153
174
  addr: Address and port to listen on (e.g., "localhost:5572")
154
175
  user: Optional username for authentication
155
176
  password: Optional password for authentication
156
177
  other_args: Additional command-line arguments
157
-
178
+
158
179
  Returns:
159
180
  Process object representing the running server
160
181
  """
@@ -172,14 +193,14 @@ class Rclone:
172
193
  ) -> CompletedProcess:
173
194
  """
174
195
  Send commands to a running rclone server.
175
-
196
+
176
197
  Args:
177
198
  addr: Address of the rclone server (e.g., "localhost:5572")
178
199
  user: Optional username for authentication
179
200
  password: Optional password for authentication
180
201
  capture: Whether to capture and return command output
181
202
  other_args: Additional command-line arguments
182
-
203
+
183
204
  Returns:
184
205
  CompletedProcess containing the command result
185
206
  """
@@ -194,13 +215,13 @@ class Rclone:
194
215
  def obscure(self, password: str) -> str:
195
216
  """
196
217
  Obscure a password for use in rclone config files.
197
-
218
+
198
219
  Converts a plaintext password to rclone's obscured format.
199
220
  Note that this is not secure encryption, just light obfuscation.
200
-
221
+
201
222
  Args:
202
223
  password: The plaintext password to obscure
203
-
224
+
204
225
  Returns:
205
226
  The obscured password string
206
227
  """
@@ -208,25 +229,25 @@ class Rclone:
208
229
 
209
230
  def ls_stream(
210
231
  self,
211
- path: str,
232
+ src: str,
212
233
  max_depth: int = -1,
213
234
  fast_list: bool = False,
214
235
  ) -> FilesStream:
215
236
  """
216
237
  List files in the given path as a stream of results.
217
-
238
+
218
239
  This method is memory-efficient for large directories as it yields
219
240
  results incrementally rather than collecting them all at once.
220
-
241
+
221
242
  Args:
222
- path: Remote path to list
243
+ src: Remote path to list
223
244
  max_depth: Maximum recursion depth (-1 for unlimited)
224
245
  fast_list: Use fast list (only recommended for listing entire repositories or small datasets)
225
-
246
+
226
247
  Returns:
227
248
  A stream of file entries that can be iterated over
228
249
  """
229
- return self.impl.ls_stream(path=path, max_depth=max_depth, fast_list=fast_list)
250
+ return self.impl.ls_stream(src=src, max_depth=max_depth, fast_list=fast_list)
230
251
 
231
252
  def save_to_db(
232
253
  self,
@@ -237,10 +258,10 @@ class Rclone:
237
258
  ) -> None:
238
259
  """
239
260
  Save files to a database (sqlite, mysql, postgres).
240
-
261
+
241
262
  Lists all files in the source path and stores their metadata in a database.
242
263
  Useful for creating searchable indexes of remote storage.
243
-
264
+
244
265
  Args:
245
266
  src: Remote path to list, this will be used to populate an entire table, so always use the root-most path.
246
267
  db_url: Database URL, like sqlite:///data.db or mysql://user:pass@localhost/db or postgres://user:pass@localhost/db
@@ -253,7 +274,7 @@ class Rclone:
253
274
 
254
275
  def ls(
255
276
  self,
256
- path: Dir | Remote | str | None = None,
277
+ src: Dir | Remote | str | None = None,
257
278
  max_depth: int | None = None,
258
279
  glob: str | None = None,
259
280
  order: Order = Order.NORMAL,
@@ -261,21 +282,21 @@ class Rclone:
261
282
  ) -> DirListing:
262
283
  """
263
284
  List files and directories at the specified path.
264
-
285
+
265
286
  Provides a detailed listing with file metadata.
266
-
287
+
267
288
  Args:
268
- path: Path to list (Dir, Remote, or string path)
289
+ src: Path to list (Dir, Remote, or string path)
269
290
  max_depth: Maximum recursion depth (None for default)
270
291
  glob: Optional glob pattern to filter results
271
292
  order: Sorting order for the results
272
293
  listing_option: What types of entries to include
273
-
294
+
274
295
  Returns:
275
296
  DirListing object containing the results
276
297
  """
277
298
  return self.impl.ls(
278
- path=path,
299
+ src=src,
279
300
  max_depth=max_depth,
280
301
  glob=glob,
281
302
  order=order,
@@ -285,9 +306,9 @@ class Rclone:
285
306
  def listremotes(self) -> list[Remote]:
286
307
  """
287
308
  List all configured remotes.
288
-
309
+
289
310
  Returns a list of all remotes defined in the rclone configuration.
290
-
311
+
291
312
  Returns:
292
313
  List of Remote objects
293
314
  """
@@ -311,10 +332,10 @@ class Rclone:
311
332
  ) -> Generator[DiffItem, None, None]:
312
333
  """
313
334
  Compare two directories and yield differences.
314
-
335
+
315
336
  Be extra careful with the src and dst values. If you are off by one
316
337
  parent directory, you will get a huge amount of false diffs.
317
-
338
+
318
339
  Args:
319
340
  src: Rclone style src path
320
341
  dst: Rclone style dst path
@@ -325,7 +346,7 @@ class Rclone:
325
346
  size_only: Compare only file sizes, not content
326
347
  checkers: Number of checker threads
327
348
  other_args: Additional command-line arguments
328
-
349
+
329
350
  Yields:
330
351
  DiffItem objects representing each difference found
331
352
  """
@@ -343,28 +364,28 @@ class Rclone:
343
364
 
344
365
  def walk(
345
366
  self,
346
- path: Dir | Remote | str,
367
+ src: Dir | Remote | str,
347
368
  max_depth: int = -1,
348
369
  breadth_first: bool = True,
349
370
  order: Order = Order.NORMAL,
350
371
  ) -> Generator[DirListing, None, None]:
351
372
  """
352
373
  Walk through the given path recursively, yielding directory listings.
353
-
374
+
354
375
  Similar to os.walk(), but for remote storage. Traverses directories
355
376
  and yields their contents.
356
-
377
+
357
378
  Args:
358
- path: Remote path, Dir, or Remote object to walk through
379
+ src: Remote path, Dir, or Remote object to walk through
359
380
  max_depth: Maximum depth to traverse (-1 for unlimited)
360
381
  breadth_first: If True, use breadth-first traversal, otherwise depth-first
361
382
  order: Sorting order for directory entries
362
-
383
+
363
384
  Yields:
364
385
  DirListing: Directory listing for each directory encountered
365
386
  """
366
387
  return self.impl.walk(
367
- path=path, max_depth=max_depth, breadth_first=breadth_first, order=order
388
+ src=src, max_depth=max_depth, breadth_first=breadth_first, order=order
368
389
  )
369
390
 
370
391
  def scan_missing_folders(
@@ -376,16 +397,16 @@ class Rclone:
376
397
  ) -> Generator[Dir, None, None]:
377
398
  """
378
399
  Find folders that exist in source but are missing in destination.
379
-
400
+
380
401
  Useful for identifying directories that need to be created before
381
402
  copying files.
382
-
403
+
383
404
  Args:
384
405
  src: Source directory or Remote to scan
385
406
  dst: Destination directory or Remote to compare against
386
407
  max_depth: Maximum depth to traverse (-1 for unlimited)
387
408
  order: Sorting order for directory entries
388
-
409
+
389
410
  Yields:
390
411
  Dir: Each directory that exists in source but not in destination
391
412
  """
@@ -394,21 +415,21 @@ class Rclone:
394
415
  )
395
416
 
396
417
  def cleanup(
397
- self, path: str, other_args: list[str] | None = None
418
+ self, src: str, other_args: list[str] | None = None
398
419
  ) -> CompletedProcess:
399
420
  """
400
421
  Cleanup any resources used by the Rclone instance.
401
-
422
+
402
423
  Removes temporary files and directories created by rclone.
403
-
424
+
404
425
  Args:
405
- path: Path to clean up
426
+ src: Path to clean up
406
427
  other_args: Additional command-line arguments
407
-
428
+
408
429
  Returns:
409
430
  CompletedProcess with the result of the cleanup operation
410
431
  """
411
- return self.impl.cleanup(path=path, other_args=other_args)
432
+ return self.impl.cleanup(src=src, other_args=other_args)
412
433
 
413
434
  def copy_to(
414
435
  self,
@@ -420,17 +441,17 @@ class Rclone:
420
441
  ) -> CompletedProcess:
421
442
  """
422
443
  Copy one file from source to destination.
423
-
444
+
424
445
  Warning - this can be slow for large files or when copying between
425
446
  different storage providers.
426
-
447
+
427
448
  Args:
428
449
  src: Rclone style src path
429
450
  dst: Rclone style dst path
430
451
  check: Whether to verify the copy with checksums
431
452
  verbose: Whether to show detailed progress
432
453
  other_args: Additional command-line arguments
433
-
454
+
434
455
  Returns:
435
456
  CompletedProcess with the result of the copy operation
436
457
  """
@@ -459,9 +480,9 @@ class Rclone:
459
480
  ) -> list[CompletedProcess]:
460
481
  """
461
482
  Copy multiple files from source to destination.
462
-
483
+
463
484
  Efficiently copies a list of files, potentially in parallel.
464
-
485
+
465
486
  Args:
466
487
  src: Rclone style src path
467
488
  dst: Rclone style dst path
@@ -479,7 +500,7 @@ class Rclone:
479
500
  max_partition_workers: Maximum number of partition workers
480
501
  multi_thread_streams: Number of streams for multi-thread copy
481
502
  other_args: Additional command-line arguments
482
-
503
+
483
504
  Returns:
484
505
  List of CompletedProcess objects for each copy operation
485
506
  """
@@ -516,9 +537,9 @@ class Rclone:
516
537
  ) -> CompletedProcess:
517
538
  """
518
539
  Copy files from source to destination.
519
-
540
+
520
541
  Recursively copies all files from src to dst.
521
-
542
+
522
543
  Args:
523
544
  src: Rclone style src path
524
545
  dst: Rclone style dst path
@@ -529,7 +550,7 @@ class Rclone:
529
550
  low_level_retries: Number of low-level retries
530
551
  retries: Number of high-level retries
531
552
  other_args: Additional command-line arguments
532
-
553
+
533
554
  Returns:
534
555
  CompletedProcess with the result of the copy operation
535
556
  """
@@ -545,19 +566,19 @@ class Rclone:
545
566
  other_args=other_args,
546
567
  )
547
568
 
548
- def purge(self, path: Dir | str) -> CompletedProcess:
569
+ def purge(self, src: Dir | str) -> CompletedProcess:
549
570
  """
550
571
  Purge a directory.
551
-
572
+
552
573
  Removes a directory and all its contents.
553
-
574
+
554
575
  Args:
555
- path: Rclone style path
556
-
576
+ src: Rclone style path
577
+
557
578
  Returns:
558
579
  CompletedProcess with the result of the purge operation
559
580
  """
560
- return self.impl.purge(path=path)
581
+ return self.impl.purge(src=src)
561
582
 
562
583
  def delete_files(
563
584
  self,
@@ -570,7 +591,7 @@ class Rclone:
570
591
  ) -> CompletedProcess:
571
592
  """
572
593
  Delete files or directories.
573
-
594
+
574
595
  Args:
575
596
  files: Files to delete (single file/path or list)
576
597
  check: Whether to verify deletions
@@ -578,7 +599,7 @@ class Rclone:
578
599
  verbose: Whether to show detailed progress
579
600
  max_partition_workers: Maximum number of partition workers
580
601
  other_args: Additional command-line arguments
581
-
602
+
582
603
  Returns:
583
604
  CompletedProcess with the result of the delete operation
584
605
  """
@@ -591,28 +612,28 @@ class Rclone:
591
612
  other_args=other_args,
592
613
  )
593
614
 
594
- def exists(self, path: Dir | Remote | str | File) -> bool:
615
+ def exists(self, src: Dir | Remote | str | File) -> bool:
595
616
  """
596
617
  Check if a file or directory exists.
597
-
618
+
598
619
  Args:
599
- path: Path to check (Dir, Remote, File, or path string)
600
-
620
+ src: Path to check (Dir, Remote, File, or path string)
621
+
601
622
  Returns:
602
623
  True if the path exists, False otherwise
603
624
  """
604
- return self.impl.exists(path=path)
625
+ return self.impl.exists(src=src)
605
626
 
606
627
  def is_synced(self, src: str | Dir, dst: str | Dir) -> bool:
607
628
  """
608
629
  Check if two directories are in sync.
609
-
630
+
610
631
  Compares the contents of src and dst to determine if they match.
611
-
632
+
612
633
  Args:
613
634
  src: Source directory (Dir object or path string)
614
635
  dst: Destination directory (Dir object or path string)
615
-
636
+
616
637
  Returns:
617
638
  True if the directories are in sync, False otherwise
618
639
  """
@@ -621,10 +642,10 @@ class Rclone:
621
642
  def modtime(self, src: str) -> str | Exception:
622
643
  """
623
644
  Get the modification time of a file or directory.
624
-
645
+
625
646
  Args:
626
647
  src: Path to the file or directory
627
-
648
+
628
649
  Returns:
629
650
  Modification time as a string, or Exception if an error occurred
630
651
  """
@@ -633,10 +654,10 @@ class Rclone:
633
654
  def modtime_dt(self, src: str) -> datetime | Exception:
634
655
  """
635
656
  Get the modification time of a file or directory as a datetime object.
636
-
657
+
637
658
  Args:
638
659
  src: Path to the file or directory
639
-
660
+
640
661
  Returns:
641
662
  Modification time as a datetime object, or Exception if an error occurred
642
663
  """
@@ -649,13 +670,13 @@ class Rclone:
649
670
  ) -> Exception | None:
650
671
  """
651
672
  Write text to a file.
652
-
673
+
653
674
  Creates or overwrites the file at dst with the given text.
654
-
675
+
655
676
  Args:
656
677
  text: Text content to write
657
678
  dst: Destination file path
658
-
679
+
659
680
  Returns:
660
681
  None if successful, Exception if an error occurred
661
682
  """
@@ -668,13 +689,13 @@ class Rclone:
668
689
  ) -> Exception | None:
669
690
  """
670
691
  Write bytes to a file.
671
-
692
+
672
693
  Creates or overwrites the file at dst with the given binary data.
673
-
694
+
674
695
  Args:
675
696
  data: Binary content to write
676
697
  dst: Destination file path
677
-
698
+
678
699
  Returns:
679
700
  None if successful, Exception if an error occurred
680
701
  """
@@ -683,10 +704,10 @@ class Rclone:
683
704
  def read_bytes(self, src: str) -> bytes | Exception:
684
705
  """
685
706
  Read bytes from a file.
686
-
707
+
687
708
  Args:
688
709
  src: Source file path
689
-
710
+
690
711
  Returns:
691
712
  File contents as bytes, or Exception if an error occurred
692
713
  """
@@ -695,10 +716,10 @@ class Rclone:
695
716
  def read_text(self, src: str) -> str | Exception:
696
717
  """
697
718
  Read text from a file.
698
-
719
+
699
720
  Args:
700
721
  src: Source file path
701
-
722
+
702
723
  Returns:
703
724
  File contents as a string, or Exception if an error occurred
704
725
  """
@@ -714,16 +735,16 @@ class Rclone:
714
735
  ) -> Exception | None:
715
736
  """
716
737
  Copy a slice of bytes from the src file to dst.
717
-
738
+
718
739
  Extracts a portion of a file based on offset and length.
719
-
740
+
720
741
  Args:
721
742
  src: Source file path
722
743
  offset: Starting position in the source file
723
744
  length: Number of bytes to copy
724
745
  outfile: Local file path to write the bytes to
725
746
  other_args: Additional command-line arguments
726
-
747
+
727
748
  Returns:
728
749
  None if successful, Exception if an error occurred
729
750
  """
@@ -740,14 +761,14 @@ class Rclone:
740
761
  ) -> CompletedProcess:
741
762
  """
742
763
  Copy a directory from source to destination.
743
-
764
+
744
765
  Recursively copies all files and subdirectories.
745
-
766
+
746
767
  Args:
747
768
  src: Source directory (Dir object or path string)
748
769
  dst: Destination directory (Dir object or path string)
749
770
  args: Additional command-line arguments
750
-
771
+
751
772
  Returns:
752
773
  CompletedProcess with the result of the copy operation
753
774
  """
@@ -759,14 +780,14 @@ class Rclone:
759
780
  ) -> CompletedProcess:
760
781
  """
761
782
  Copy a remote to another remote.
762
-
783
+
763
784
  Copies all contents from one remote storage to another.
764
-
785
+
765
786
  Args:
766
787
  src: Source remote
767
788
  dst: Destination remote
768
789
  args: Additional command-line arguments
769
-
790
+
770
791
  Returns:
771
792
  CompletedProcess with the result of the copy operation
772
793
  """
@@ -782,20 +803,20 @@ class Rclone:
782
803
  ) -> Exception | None:
783
804
  """
784
805
  Copy a large file to S3 with resumable upload capability.
785
-
806
+
786
807
  This method splits the file into parts for parallel upload and can
787
808
  resume interrupted transfers using a custom algorithm in python.
788
-
809
+
789
810
  Particularly useful for very large files where network interruptions
790
811
  are likely.
791
-
812
+
792
813
  Args:
793
814
  src: Source file path (format: remote:bucket/path/file)
794
815
  dst: Destination file path (format: remote:bucket/path/file)
795
816
  part_infos: Optional list of part information for resuming uploads
796
817
  upload_threads: Number of parallel upload threads
797
818
  merge_threads: Number of threads for merging uploaded parts
798
-
819
+
799
820
  Returns:
800
821
  None if successful, Exception if an error occurred
801
822
  """
@@ -812,6 +833,7 @@ class Rclone:
812
833
  src: Remote | Dir | str,
813
834
  outdir: Path,
814
835
  allow_writes: bool | None = False,
836
+ transfers: int | None = None, # number of writes to perform in parallel
815
837
  use_links: bool | None = None,
816
838
  vfs_cache_mode: str | None = None,
817
839
  verbose: bool | None = None,
@@ -822,13 +844,14 @@ class Rclone:
822
844
  ) -> Mount:
823
845
  """
824
846
  Mount a remote or directory to a local path.
825
-
847
+
826
848
  Makes remote storage accessible as a local filesystem.
827
-
849
+
828
850
  Args:
829
851
  src: Remote or directory to mount
830
852
  outdir: Local path to mount to
831
853
  allow_writes: Whether to allow write operations
854
+ transfers: Number of parallel write operations
832
855
  use_links: Whether to use symbolic links
833
856
  vfs_cache_mode: VFS cache mode (e.g., "full", "minimal")
834
857
  verbose: Whether to show detailed output
@@ -836,7 +859,7 @@ class Rclone:
836
859
  cache_dir_delete_on_exit: Whether to delete cache on exit
837
860
  log: Path to write logs to
838
861
  other_args: Additional command-line arguments
839
-
862
+
840
863
  Returns:
841
864
  Mount object representing the mounted filesystem
842
865
  """
@@ -844,6 +867,7 @@ class Rclone:
844
867
  src=src,
845
868
  outdir=outdir,
846
869
  allow_writes=allow_writes,
870
+ transfers=transfers,
847
871
  use_links=use_links,
848
872
  vfs_cache_mode=vfs_cache_mode,
849
873
  verbose=verbose,
@@ -861,19 +885,19 @@ class Rclone:
861
885
  ) -> HttpServer:
862
886
  """
863
887
  Serve a remote or directory via HTTP.
864
-
888
+
865
889
  Creates an HTTP server that provides access to the specified remote.
866
890
  The returned HttpServer object includes a client for fetching files.
867
-
891
+
868
892
  This is useful for providing web access to remote storage or for
869
893
  accessing remote files from applications that support HTTP but not
870
894
  the remote's native protocol.
871
-
895
+
872
896
  Args:
873
897
  src: Remote or directory to serve
874
898
  addr: Network address and port to serve on (default: localhost:8080)
875
899
  other_args: Additional arguments to pass to rclone
876
-
900
+
877
901
  Returns:
878
902
  HttpServer object with methods for accessing the served content
879
903
  """
@@ -890,9 +914,9 @@ class Rclone:
890
914
  ) -> SizeResult | Exception:
891
915
  """
892
916
  Get the size of a list of files.
893
-
917
+
894
918
  Calculates the total size of the specified files.
895
-
919
+
896
920
  Args:
897
921
  src: Base path for the files
898
922
  files: List of file paths relative to src
@@ -900,10 +924,10 @@ class Rclone:
900
924
  other_args: Additional command-line arguments
901
925
  check: Whether to verify file integrity
902
926
  verbose: Whether to show detailed output
903
-
927
+
904
928
  Returns:
905
929
  SizeResult with size information, or Exception if an error occurred
906
-
930
+
907
931
  Example:
908
932
  size_files("remote:bucket", ["path/to/file1", "path/to/file2"])
909
933
  """
@@ -919,10 +943,10 @@ class Rclone:
919
943
  def size_file(self, src: str) -> SizeSuffix | Exception:
920
944
  """
921
945
  Get the size of a file.
922
-
946
+
923
947
  Args:
924
948
  src: Path to the file
925
-
949
+
926
950
  Returns:
927
951
  SizeSuffix object representing the file size, or Exception if an error occurred
928
952
  """
@@ -1,4 +1,4 @@
1
- rclone_api/__init__.py,sha256=lh_dJHiXVGqgrOcorUBu9cBy76e1W62YYmhiM7cuM78,32228
1
+ rclone_api/__init__.py,sha256=uhoHM66jDRlk0Hq4PTrk7QZE6VcJqiu5Jeo9nj34edk,32380
2
2
  rclone_api/cli.py,sha256=dibfAZIh0kXWsBbfp3onKLjyZXo54mTzDjUdzJlDlWo,231
3
3
  rclone_api/completed_process.py,sha256=_IZ8IWK7DM1_tsbDEkH6wPZ-bbcrgf7A7smls854pmg,1775
4
4
  rclone_api/config.py,sha256=f6jEAxVorGFr31oHfcsu5AJTtOJj2wR5tTSsbGGZuIw,2558
@@ -19,7 +19,7 @@ rclone_api/install.py,sha256=Xb1BRn8rQcSpSd4dzmvIOELP2zM2DytUeIZ6jzv738A,2893
19
19
  rclone_api/log.py,sha256=VZHM7pNSXip2ZLBKMP7M1u-rp_F7zoafFDuR8CPUoKI,1271
20
20
  rclone_api/mount.py,sha256=TE_VIBMW7J1UkF_6HRCt8oi_jGdMov4S51bm2OgxFAM,10045
21
21
  rclone_api/process.py,sha256=tGooS5NLdPuqHh7hCH8SfK44A6LGftPQCPQUNgSo0a0,5714
22
- rclone_api/rclone_impl.py,sha256=emZjLztunr2tJ2a8YYM4XIQk-8Vb-uEcfNjBAqZAGqg,46184
22
+ rclone_api/rclone_impl.py,sha256=fhpl149P_dtfxTfwT0hHBaCIe4AJ3BHLXLVsC-QzmPo,46304
23
23
  rclone_api/remote.py,sha256=mTgMTQTwxUmbLjTpr-AGTId2ycXKI9mLX5L7PPpDIoc,520
24
24
  rclone_api/rpath.py,sha256=Y1JjQWcie39EgQrq-UtbfDz5yDLCwwfu27W7AQXllSE,2860
25
25
  rclone_api/scan_missing_folders.py,sha256=-8NCwpCaHeHrX-IepCoAEsX1rl8S-GOCxcIhTr_w3gA,4747
@@ -52,9 +52,9 @@ rclone_api/s3/multipart/upload_parts_inline.py,sha256=V7syKjFyVIe4U9Ahl5XgqVTzt9
52
52
  rclone_api/s3/multipart/upload_parts_resumable.py,sha256=diJoUpVYow6No_dNgOZIYVsv43k4evb6zixqpzWJaUk,9771
53
53
  rclone_api/s3/multipart/upload_parts_server_side_merge.py,sha256=Fp2pdrs5dONQI9LkfNolgAGj1-Z2V1SsRd0r0sreuXI,18040
54
54
  rclone_api/s3/multipart/upload_state.py,sha256=f-Aq2NqtAaMUMhYitlICSNIxCKurWAl2gDEUVizLIqw,6019
55
- rclone_api-1.5.3.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
56
- rclone_api-1.5.3.dist-info/METADATA,sha256=sL32Uens2_h-RmqlM_4J3XyVB1G72Vn7MAScW3GJLi8,32776
57
- rclone_api-1.5.3.dist-info/WHEEL,sha256=rF4EZyR2XVS6irmOHQIJx2SUqXLZKRMUrjsg8UwN-XQ,109
58
- rclone_api-1.5.3.dist-info/entry_points.txt,sha256=fJteOlYVwgX3UbNuL9jJ0zUTuX2O79JFAeNgK7Sw7EQ,255
59
- rclone_api-1.5.3.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
60
- rclone_api-1.5.3.dist-info/RECORD,,
55
+ rclone_api-1.5.5.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
56
+ rclone_api-1.5.5.dist-info/METADATA,sha256=BK7GrWlhZN2qAW2UCnB9W5xAyvkN5m0cez2TpgGJcWQ,32633
57
+ rclone_api-1.5.5.dist-info/WHEEL,sha256=rF4EZyR2XVS6irmOHQIJx2SUqXLZKRMUrjsg8UwN-XQ,109
58
+ rclone_api-1.5.5.dist-info/entry_points.txt,sha256=fJteOlYVwgX3UbNuL9jJ0zUTuX2O79JFAeNgK7Sw7EQ,255
59
+ rclone_api-1.5.5.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
60
+ rclone_api-1.5.5.dist-info/RECORD,,