@@ -113,6 +113,17 @@ def get_workspace(args):
113113 print (json .dumps (workspace_json , indent = 2 ))
114114
115115
116+
117+ def get_workspace_project_version (args ):
118+ #api_key = load_roboflow_api_key(args.workspaceId)
119+ rf = roboflow .Roboflow (args .api_key )
120+ workspace = rf .workspace ()
121+ print ('workspace' ,workspace )
122+ project = workspace .project (args .project )
123+ print ('project' ,project )
124+ version = project .version (args .version_number )
125+ print ('version' ,version )
126+
116127def get_project (args ):
117128 workspace_url = args .workspace or get_conditional_configuration_variable ("RF_WORKSPACE" , default = None )
118129 api_key = load_roboflow_api_key (workspace_url )
@@ -161,6 +172,9 @@ def _argparser():
161172 _add_projects_parser (subparsers )
162173 _add_workspaces_parser (subparsers )
163174 _add_upload_model_parser (subparsers )
175+ _add_get_workspace_project_version_parser (subparsers )
176+
177+
164178 return parser
165179
166180
@@ -410,7 +424,34 @@ def _add_upload_model_parser(subparsers):
410424 )
411425 upload_model_parser .set_defaults (func = upload_model )
412426
413-
427+ def _add_get_workspace_project_version_parser (subparsers ):
428+ workspace_project_version_parser = subparsers .add_parser (
429+ "get_workspace_info" ,
430+ help = "get workspace project version info" ,
431+ )
432+ workspace_project_version_parser .add_argument (
433+ "-a" ,
434+ dest = "api_key" ,
435+ help = "api_key" ,
436+ )
437+ workspace_project_version_parser .add_argument (
438+ "-w" ,
439+ dest = "workspace" ,
440+ help = "specify a workspace url or id (will use default workspace if not specified)" ,
441+ )
442+ workspace_project_version_parser .add_argument (
443+ "-p" ,
444+ dest = "project" ,
445+ help = "project_id to upload the model into" ,
446+ )
447+ workspace_project_version_parser .add_argument (
448+ "-v" ,
449+ dest = "version_number" ,
450+ type = int ,
451+ help = "version number to upload the model to" ,
452+ )
453+ workspace_project_version_parser .set_defaults (func = get_workspace_project_version )
454+
414455def _add_login_parser (subparsers ):
415456 login_parser = subparsers .add_parser ("login" , help = "Log in to Roboflow" )
416457 login_parser .set_defaults (func = login )
0 commit comments