We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3308d3 commit eed2f2bCopy full SHA for eed2f2b
slkspec/core.py
@@ -440,6 +440,29 @@ def ls(
440
if detail:
441
return detail_list
442
return filelist.filename.tolist()
443
+
444
+ def cat_file(self, path, start=None, end=None):
445
+ """Get file content
446
447
+ Inputs
448
+ ------
449
+ path : str
450
+ file to open
451
+ start : int
452
+ seek position within file, optional
453
+ end : int
454
+ end position of file read, optional
455
456
+ Returns
457
+ -------
458
+ - bytes if start and end are given
459
+ - file object otherwise
460
+ """
461
+ slk_file = self._open(path, mode="rb")
462
+ if isinstance(start, int) and isinstance(end, int):
463
+ slk_file.seek(start)
464
+ return slk_file.read(end - start)
465
+ return slk_file
466
467
def _open(
468
self,
0 commit comments