Skip to content

Commit

Permalink
feat(files): Added file manager interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse-numerous committed Apr 27, 2024
1 parent 1e0c6be commit 7a47c2b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/numerous/files/file_manager.py
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."""
...

0 comments on commit 7a47c2b

Please sign in to comment.