-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(files): Added file manager interface
- Loading branch information
1 parent
1e0c6be
commit 7a47c2b
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Interface for file management operations.""" | ||
from abc import ABC, abstractmethod | ||
from pathlib import Path | ||
|
||
StrOrPath = Path | str | ||
|
||
class FileManager(ABC): | ||
|
||
"""Interface for file management operations.""" | ||
|
||
@abstractmethod | ||
def put(self, dst: StrOrPath, src: StrOrPath) -> None: | ||
"""Upload a file to a path.""" | ||
... | ||
|
||
@abstractmethod | ||
def remove(self, path: StrOrPath) -> None: | ||
"""Remove a file at a path.""" | ||
... | ||
|
||
@abstractmethod | ||
def list(self, path: StrOrPath | None) -> None: | ||
"""List files at a path.""" | ||
... | ||
|
||
@abstractmethod | ||
def move(self, src: StrOrPath, dst: StrOrPath) -> None: | ||
"""Move a file from a source to a destination.""" | ||
... | ||
|
||
@abstractmethod | ||
def copy(self, src: StrOrPath, dst: StrOrPath) -> None: | ||
"""Copy a file from a source to a destination.""" | ||
... | ||
|
||
@abstractmethod | ||
def get(self, src: StrOrPath, dest: Path|str) -> None: | ||
"""Download a file from a source to a destination.""" | ||
... |