This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
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: Create command line interface for a migrate command (#1109)
Closes #1108. ### Summary of Changes Created a migrate cli command, that takes two api files, an annotation file, and an output path as input ### Testing Instructions Run Terminal with `parse-package migrate -a1 apiv1.json -a2 apiv2.json -a annotations.json -o out` Co-authored-by: Aclrian <[email protected]>
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 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
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
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,20 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from package_parser.processing.api.model import API | ||
|
||
|
||
def _run_migrate_command( | ||
apiv1_file_path: Path, | ||
annotations_file_path: Path, | ||
apiv2_file_path: Path, | ||
out_dir_path: Path, | ||
) -> None: | ||
pass | ||
|
||
|
||
def _read_api_file(api_file_path: Path) -> API: | ||
with open(api_file_path) as api_file: | ||
api_json = json.load(api_file) | ||
|
||
return API.from_json(api_json) |