feat(doi): add DOI-based path access for commands

Support accessing repositories using DOI strings with optional subpaths
across ls, download, metadata, and file-metadata commands.

- Implement GET v3/doi/{id}/ API model and client calls
- Parse and resolve DOI paths into respective folder and files
- Extract common folder and file resolution logic to shared helpers
- Update README with example DOI-based shell commands
This commit is contained in:
2026-06-12 01:28:40 +09:00
parent 04c0003a61
commit 5bdf837941
14 changed files with 301 additions and 27 deletions
+2 -6
View File
@@ -25,13 +25,9 @@ class FileMetadataCommand(BaseCommand):
@classmethod
def file_metadata(cls, remote_path: str, password: str | None) -> None:
(remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path)
r_path = r_path.rstrip("/")
r_dirname = os.path.dirname(r_path)
r_basename = os.path.basename(r_path)
remote = remote_path.split(":", 1)[0] if ":" in remote_path else ""
connection = cls._create_connection(remote)
laboratory = cls._find_laboratory(connection, laboratory_name)
folder = cls._find_folder(connection, laboratory, r_dirname, password)
folder, laboratory, r_basename = cls._resolve_file(connection, remote_path, password)
files = cls._find_files(connection, folder.id)
file = find_file(files, r_basename)
if file is None: