@@ -113,6 +113,17 @@ def get_workspace(args):
113113 print (json .dumps (workspace_json , indent = 2 ))
114114
115115
116+ def get_workspace_project_version (args ):
117+ # api_key = load_roboflow_api_key(args.workspaceId)
118+ rf = roboflow .Roboflow (args .api_key )
119+ workspace = rf .workspace ()
120+ print ("workspace" , workspace )
121+ project = workspace .project (args .project )
122+ print ("project" , project )
123+ version = project .version (args .version_number )
124+ print ("version" , version )
125+
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,8 @@ 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+
164177 return parser
165178
166179
@@ -411,6 +424,35 @@ def _add_upload_model_parser(subparsers):
411424 upload_model_parser .set_defaults (func = upload_model )
412425
413426
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+
455+
414456def _add_login_parser (subparsers ):
415457 login_parser = subparsers .add_parser ("login" , help = "Log in to Roboflow" )
416458 login_parser .set_defaults (func = login )
0 commit comments