Commit Graph

76 Commits

Author SHA1 Message Date
orrisroot d59a150b4f chore(release): bump version to 1.3.18
Bump the package version to 1.3.18, upgrade dependencies,
consolidate module exports, add a unit test suite, and document
all changes.

- Bump package version to 1.3.18 in pyproject.toml
- Upgrade pydantic-settings to 2.14.2 and pyright to 1.1.411
- Consolidate package exports in mdrsclient/__init__.py
- Add a comprehensive unit test suite in tests/test_commands.py
- Document testing execution and add full history in CHANGELOG.md
2026-07-02 23:47:57 +09:00
orrisroot b95fc0cd7d refactor(config): abstract config storage and enable dependency injection
Abstract the configuration storage mechanism to allow using custom
configurations, such as in-memory setups, when using the tool as
a library. This aligns the configuration architecture with the
session cache abstraction.

- Define ConfigInterface protocol and InMemoryConfig class
- Make CacheFile, InMemoryCache, ConfigFile, and InMemoryConfig
  explicitly inherit their interfaces
- Update MdrsService and MdrsClient to accept customizable
  config_class and config instances
- Add validation to check remote parameter consistency in
  create_connection
- Remove unused imports across command files
2026-07-02 23:30:33 +09:00
orrisroot 8ce9e09e69 refactor: use services layer and modularize transfer operations
Decouple CLI commands from internal helper logic and consolidate the
core file transfer operations in the service layer to improve library
portability.

- Make MdrsClient subclass MdrsService to inherit resource resolution.
- Remove all deprecated helper methods from BaseCommand.
- Move core upload and download logic to a new transfer module.
- Refactor all CLI commands to route actions through MdrsClient.
- Eliminate circular imports between client and CLI command modules.
2026-07-02 23:16:53 +09:00
orrisroot 36cad6db52 refactor: extract MdrsClient service layer for library portability
To improve the tool's portability as a Python library, the core logic
has been decoupled from the CLI interface. This allows developers to
programmatically interact with MDRS without relying on CLI-specific
argument parsing or local file-based caches.

- Introduce `MdrsClient` service layer to handle core operations.
- Abstract authentication state using `CacheInterface` and `InMemoryCache`.
- Migrate all CLI commands to utilize `MdrsClient` for execution.
- Separate `Doi` data model from API responses and move to `models/doi.py`.
- Update `README.md` to include Python API usage examples.
- Bump package version to 1.3.17.
2026-07-02 13:07:18 +09:00
orrisroot 809140dfbc fix(download): retrieve full folder to resolve type error
Retrieve the full Folder object from FoldersApi instead of using the
FolderSimple returned by find_sub_folder when resolving DOI subfolders.
This fixes a type checker error under the upgraded pyright, and avoids
a potential AttributeError at runtime due to FolderSimple lacking the
path attribute.

Also upgrade dependencies and bump version to 1.3.16 in pyproject.toml.
2026-06-12 10:25:03 +09:00
orrisroot 5bdf837941 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
2026-06-12 01:28:40 +09:00
orrisroot 04c0003a61 fix(connection): support absolute download urls for public data 2026-06-11 21:04:28 +09:00
orrisroot 4283481695 fix: apply NFC normalization to filenames and folder names sent to server
On macOS, local filenames and directory names may be in NFD encoding
(decomposed Unicode). Without normalization, files and folders are
created on the server with NFD names, inconsistent with the server's
NFC convention.

Apply normalize("NFC", ...) before sending names to the server in:
- FilesApi.create(): filename in multipart upload
- FilesApi.update(): filename in multipart upload
- UploadCommand: directory name in FoldersApi.create()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 12:25:59 +09:00
orrisroot ddb4300d85 feat(config): simplify list command and add subcommand aliases
- config list: remove -l/--long option, always display URL
- config list: add ls alias (already existed, kept)
- config delete: add rm alias (alongside existing remove alias)
- README: add config update, config list, config delete sections

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 18:59:07 +09:00
orrisroot 68670a6588 fix(ls): rename --quick to --quiet; add version command; bump to 1.3.14
- Fix ls -q long option name: --quick → --quiet (typo fix)
- Remove mdrsclient/VERSION file; read version via importlib.metadata
- Bump version 1.3.13 → 1.3.14
- Add Python 3.14 to supported classifiers; promote to Development Status 4 - Beta
- Add `version` subcommand (prints "mdrs <version>")
- Document `version` command in README

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 17:41:37 +09:00
pw-serizawa 634b5f1a13 update version to 1.3.12 2025-07-02 18:34:11 +09:00
pw-serizawa 95f22ea5f9 fix for file.list api pagination 2025-06-26 17:13:06 +09:00
orrisroot fffb686023 update version to 1.3.12 2025-05-20 18:02:47 +09:00
orrisroot 893bc77128 fixed bug to download file if skip flag is present. 2025-05-20 17:50:11 +09:00
orrisroot 7b3f1f2d09 update version to 1.3.11 2025-01-21 18:33:41 +09:00
orrisroot 8a5e1b68b7 follow-up fixes due to recent User API specification changes. 2025-01-21 18:30:22 +09:00
orrisroot dd00973bea update version number to 1.3.10. 2024-12-23 20:43:57 +09:00
orrisroot 0e5685d5ea update libraries and version number. 2024-12-23 14:28:25 +09:00
orrisroot 6a2810f603 show summary when file download fails and delete broken files. 2024-12-23 13:58:14 +09:00
orrisroot d5ac5cd427 fixed compatibility with python 3.10. 2024-10-23 18:33:12 +09:00
orrisroot f2f898c263 check the exception to unexpected responses from the server. 2024-09-18 11:22:03 +09:00
orrisroot 24172dc65c implemented -s --skip-if-file-exists option for download commnad. 2024-09-18 10:56:40 +09:00
orrisroot f2c5a06cb4 implemented --exclude argument for download subcommand. 2024-07-22 14:35:34 +09:00
orrisroot 3e8ab8de3a update version to 1.3.6. 2024-07-08 20:37:28 +09:00
orrisroot d392379235 implemented to cancel to recursive download if some files failed to download. 2024-07-08 20:35:48 +09:00
orrisroot c8b16939d7 update version to 1.3.5. 2024-07-08 18:13:09 +09:00
orrisroot 0d8deb02d7 add token check for file download operation. 2024-07-08 18:07:26 +09:00
orrisroot c2a67aa861 removed debug code. 2024-07-04 15:21:45 +09:00
orrisroot 4696b9799c add some aliases for config sub command. 2024-07-04 12:35:59 +09:00
orrisroot 020ef8835a fixed bug to upload large file. 2024-07-04 12:33:57 +09:00
orrisroot dbfc68c396 implemented -s --skip-if-file-exists option for upload commnad. 2024-02-13 10:48:01 +09:00
orrisroot c3e2dfbd8e add -u and -p option to login commnand. 2024-02-09 18:22:13 +09:00
orrisroot ce0a608db2 fixed bug to resolve local files for recursive file upload. 2023-12-20 19:42:06 +09:00
orrisroot 219858e0b6 removed debug comment. 2023-12-18 17:21:31 +09:00
orrisroot a281a97b3e show folder size. 2023-12-18 16:59:53 +09:00
orrisroot 64f64b82dc fixed download url and removed debug comment. 2023-12-18 16:32:24 +09:00
orrisroot 9284346153 real path should not be used when creating distination file list. 2023-12-18 16:23:46 +09:00
orrisroot 292ca1df27 changed API endpoint from v2 to v3. 2023-12-12 20:05:46 +09:00
orrisroot f10b42a1f2 updated auth token handling using new users api. 2023-12-07 14:46:57 +09:00
orrisroot ac34a26b02 follow-up recent specification changes about foldeer access level. 2023-10-04 12:49:13 +09:00
orrisroot 79f1b708cb followup recent updates around auth api. 2023-10-04 11:30:16 +09:00
orrisroot 905577fe74 introduced poetry and update vscode related environments. 2023-10-04 11:29:08 +09:00
orrisroot 4641b9304e set destination folder name using name attribute of folder copy api. 2023-07-26 19:59:07 +09:00
orrisroot 8588c6ce70 update version to 1.1.1. 2023-07-26 17:59:35 +09:00
orrisroot 4d87b55b40 add new command cp. 2023-07-20 11:43:07 +09:00
orrisroot 08d8a0626a fixed type errors when pylance type checking mode is strict. 2023-07-19 21:47:47 +09:00
orrisroot 23025bd679 migrate obsoleted function parse_obj_as to TypeAdapter().validate_python(). 2023-07-19 14:43:16 +09:00
orrisroot b569c20b6e support case insensitive and normalized file and folder names. 2023-07-19 13:46:23 +09:00
orrisroot 0f12549ec3 support pydantic version 2. 2023-07-19 12:52:40 +09:00
orrisroot 96637e2d12 fixed bug to output redandant sub_folders/files array list. 2023-06-07 11:05:10 +09:00