qbraid-cli 0.10.6__py3-none-any.whl → 0.10.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qbraid-cli might be problematic. Click here for more details.

qbraid_cli/account/app.py CHANGED
@@ -11,6 +11,7 @@ from typing import Any
11
11
  import rich
12
12
  import typer
13
13
 
14
+ from qbraid_cli.configure.actions import QBRAID_ORG_MODEL_ENABLED
14
15
  from qbraid_cli.handlers import run_progress_task
15
16
 
16
17
  account_app = typer.Typer(help="Manage qBraid account.", no_args_is_help=True)
@@ -51,9 +52,10 @@ def account_info():
51
52
  "email": user.get("email"),
52
53
  "joinedDate": user.get("createdAt", "Unknown"),
53
54
  "activePlan": user.get("activePlan", "") or "Free",
54
- "organization": personal_info.get("organization", "") or "qbraid",
55
55
  "role": personal_info.get("role", "") or "guest",
56
56
  }
57
+ if QBRAID_ORG_MODEL_ENABLED:
58
+ metadata["organization"] = personal_info.get("organization", "") or "qbraid"
57
59
 
58
60
  return metadata
59
61
 
@@ -25,6 +25,8 @@ from rich.console import Console
25
25
 
26
26
  from qbraid_cli.handlers import handle_filesystem_operation
27
27
 
28
+ QBRAID_ORG_MODEL_ENABLED = False # Set to True if organization/workspace model is enabled
29
+
28
30
 
29
31
  def validate_input(key: str, value: str) -> str:
30
32
  """Validate the user input based on the key.
@@ -96,16 +98,21 @@ def default_action(section: str = DEFAULT_CONFIG_SECTION):
96
98
 
97
99
  default_values = {
98
100
  "url": DEFAULT_ENDPOINT_URL,
99
- "organization": DEFAULT_ORGANIZATION,
100
- "workspace": DEFAULT_WORKSPACE,
101
101
  }
102
+ if QBRAID_ORG_MODEL_ENABLED:
103
+ default_values["organization"] = DEFAULT_ORGANIZATION
104
+ default_values["workspace"] = DEFAULT_WORKSPACE
102
105
 
103
106
  config[section]["url"] = prompt_for_config(config, section, "url", default_values)
104
107
  config[section]["api-key"] = prompt_for_config(config, section, "api-key", default_values)
105
- config[section]["organization"] = prompt_for_config(
106
- config, section, "organization", default_values
107
- )
108
- config[section]["workspace"] = prompt_for_config(config, section, "workspace", default_values)
108
+
109
+ if QBRAID_ORG_MODEL_ENABLED:
110
+ config[section]["organization"] = prompt_for_config(
111
+ config, section, "organization", default_values
112
+ )
113
+ config[section]["workspace"] = prompt_for_config(
114
+ config, section, "workspace", default_values
115
+ )
109
116
 
110
117
  for key in list(config[section]):
111
118
  if not config[section][key]:
qbraid_cli/devices/app.py CHANGED
@@ -12,7 +12,7 @@ import typer
12
12
  from rich.console import Console
13
13
 
14
14
  from qbraid_cli.devices.validation import validate_provider, validate_status, validate_type
15
- from qbraid_cli.handlers import run_progress_task
15
+ from qbraid_cli.handlers import print_formatted_data, run_progress_task
16
16
 
17
17
  devices_app = typer.Typer(help="Manage qBraid quantum devices.", no_args_is_help=True)
18
18
 
@@ -29,7 +29,10 @@ def devices_list( # pylint: disable=too-many-branches
29
29
  None,
30
30
  "--provider",
31
31
  "-p",
32
- help="'AWS'|'IBM'|'IonQ'|'Rigetti'|'OQC'|'QuEra'",
32
+ help=(
33
+ "'AWS'|'IBM'|'IonQ'|'Rigetti'|'OQC'|'QuEra'|'IQM'|"
34
+ "'NEC'|'qBraid'|'Azure'|'Pasqal'|'Quantinuum'|'Equal1'"
35
+ ),
33
36
  callback=validate_provider,
34
37
  ),
35
38
  ) -> None:
@@ -76,5 +79,25 @@ def devices_list( # pylint: disable=too-many-branches
76
79
  console.print(f"\n{msg}", style="italic", justify="left")
77
80
 
78
81
 
82
+ @devices_app.command(name="get")
83
+ def devices_get(
84
+ device_id: str = typer.Argument(..., help="The ID of the device to get."),
85
+ fmt: bool = typer.Option(
86
+ True, "--no-fmt", help="Disable rich console formatting (output raw data)"
87
+ ),
88
+ ) -> None:
89
+ """Get a qBraid quantum device."""
90
+
91
+ def get_device():
92
+ from qbraid_core.services.quantum import QuantumClient
93
+
94
+ client = QuantumClient()
95
+ return client.get_device(device_id)
96
+
97
+ data: dict[str, Any] = run_progress_task(get_device)
98
+
99
+ print_formatted_data(data, fmt)
100
+
101
+
79
102
  if __name__ == "__main__":
80
103
  devices_app()
qbraid_cli/envs/app.py CHANGED
@@ -128,6 +128,7 @@ def envs_create( # pylint: disable=too-many-statements
128
128
  env_config.description = environment.get("description")
129
129
  env_config.tags = environment.get("tags")
130
130
  env_config.kernel_name = environment.get("kernelName")
131
+ env_config.python_version = python_version
131
132
 
132
133
  slug_path = env_path / slug
133
134
  description = "None" if description == "" else description
qbraid_cli/files/app.py CHANGED
@@ -27,10 +27,10 @@ def is_file_less_than_10mb(file_path: Path) -> bool:
27
27
  Returns:
28
28
  bool: True if the file is less than 10MB, False otherwise.
29
29
  """
30
- TEN_MB = 10 * 1024 * 1024 # 10 * 1024 KB * 1024 bytes
30
+ ten_mb = 10485760 # 10 MB in bytes (10 * 1024 * 1024)
31
31
 
32
32
  try:
33
- return file_path.stat().st_size < TEN_MB
33
+ return file_path.stat().st_size < ten_mb
34
34
  except OSError:
35
35
  return False
36
36
 
qbraid_cli/handlers.py CHANGED
@@ -89,6 +89,22 @@ def handle_filesystem_operation(operation: Callable[[], None], path: Path) -> No
89
89
  raise QbraidException(f"Failed to save configuration to {path}: {err.strerror}") from err
90
90
 
91
91
 
92
+ def print_formatted_data(data: Any, fmt: bool = True) -> None:
93
+ """
94
+ Print data with optional formatting using rich console.
95
+
96
+ Args:
97
+ data (Any): The data to be printed.
98
+ fmt (bool): If True, use rich console formatting. If False, use standard print.
99
+ Defaults to True.
100
+ """
101
+ if fmt:
102
+ console = Console()
103
+ console.print(data)
104
+ else:
105
+ print(data)
106
+
107
+
92
108
  def run_progress_task(
93
109
  operation: Callable[..., Any],
94
110
  *args,
qbraid_cli/jobs/app.py CHANGED
@@ -11,7 +11,7 @@ from typing import Any, Callable
11
11
  import typer
12
12
  from rich.console import Console
13
13
 
14
- from qbraid_cli.handlers import handle_error, run_progress_task
14
+ from qbraid_cli.handlers import handle_error, print_formatted_data, run_progress_task
15
15
  from qbraid_cli.jobs.toggle_braket import disable_braket, enable_braket
16
16
  from qbraid_cli.jobs.validation import handle_jobs_state, run_progress_get_state, validate_library
17
17
 
@@ -107,11 +107,8 @@ def jobs_list(
107
107
 
108
108
  result: tuple[Any, Callable] = run_progress_task(import_jobs)
109
109
  client, process_job_data = result
110
- # https://github.com/qBraid/api/issues/644
111
- # raw_data = client.search_jobs(query={"numResults": limit})
112
- raw_data = client.search_jobs(query={})
110
+ raw_data = client.search_jobs(query={"resultsPerPage": limit, "page": 0})
113
111
  job_data, msg = process_job_data(raw_data)
114
- job_data = job_data[:limit]
115
112
 
116
113
  longest_job_id = max(len(item[0]) for item in job_data)
117
114
  spacing = longest_job_id + 5
@@ -148,5 +145,25 @@ def jobs_list(
148
145
  handle_error(message="Failed to fetch quantum jobs.")
149
146
 
150
147
 
148
+ @jobs_app.command(name="get")
149
+ def jobs_get(
150
+ job_id: str = typer.Argument(..., help="The ID of the job to get."),
151
+ fmt: bool = typer.Option(
152
+ True, "--no-fmt", help="Disable rich console formatting (output raw data)"
153
+ ),
154
+ ) -> None:
155
+ """Get a qBraid Quantum Job."""
156
+
157
+ def get_job():
158
+ from qbraid_core.services.quantum import QuantumClient
159
+
160
+ client = QuantumClient()
161
+ return client.get_job(job_id)
162
+
163
+ data: dict[str, Any] = run_progress_task(get_job)
164
+
165
+ print_formatted_data(data, fmt)
166
+
167
+
151
168
  if __name__ == "__main__":
152
169
  jobs_app()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qbraid-cli
3
- Version: 0.10.6
3
+ Version: 0.10.8
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License: Proprietary
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  Requires-Dist: typer>=0.12.1
31
31
  Requires-Dist: rich>=10.11.0
32
- Requires-Dist: click
32
+ Requires-Dist: click<=8.1.8
33
33
  Requires-Dist: qbraid-core<0.2,>=0.1.41
34
34
  Provides-Extra: jobs
35
35
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
@@ -1,11 +1,10 @@
1
1
  qbraid_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- qbraid_cli/_version.py,sha256=sdKAJx2O9MyMOWKPhmLMjrEaHBGify7UEi83jFKJhxU,513
3
2
  qbraid_cli/exceptions.py,sha256=KjlhYJhSHMVazaNiBjD_Ur06w4sekP8zRsFzBdyIpno,672
4
- qbraid_cli/handlers.py,sha256=B9H1Qw6yx8izrqp9OGR2TgSJa_mxA8KLXUkX8LB7Feg,7650
3
+ qbraid_cli/handlers.py,sha256=qRxrB37-n9WBYIAf63KLEAPSQ7Hfhb1qRaHgsA2TVH8,8069
5
4
  qbraid_cli/main.py,sha256=aSOQyoRRvKBJBcx8VtU4zKZ2WHvGKHhw8I-WiRwPxcE,3926
6
5
  qbraid_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
6
  qbraid_cli/account/__init__.py,sha256=smlpUcVkM3QEbJG0norGM7i71XBJlUGQYByswTfPnmg,181
8
- qbraid_cli/account/app.py,sha256=1UogauwgX0Hnr7H6cBV2Qv-lT6aRpRLAimCyLi0afGI,1843
7
+ qbraid_cli/account/app.py,sha256=_On93HBaBmyizcxnArpdN6zeoA1lFMNPhya0DvBDTJ4,1956
9
8
  qbraid_cli/admin/__init__.py,sha256=qcWD5mQEUCtr49mrUpZmk7eGDe0L_Gtc8RwZmzIXSwo,175
10
9
  qbraid_cli/admin/app.py,sha256=i_JeyJYHT6qoJrsTuf_eippp7AG6ZJ_N6-Dsrpv2XHQ,1476
11
10
  qbraid_cli/admin/headers.py,sha256=QWAEuOu3rqumngLlOaGTI2R2wqyqmC0gUNpRt_74pd0,10610
@@ -13,20 +12,20 @@ qbraid_cli/admin/validation.py,sha256=fhpttxupCGBk56ExQPuuQm8nMnptLLy_8sj-EjpM8g
13
12
  qbraid_cli/chat/__init__.py,sha256=NO41vndEdfr0vDynNcmHFh-nhzWjnWqGm4M9parikck,258
14
13
  qbraid_cli/chat/app.py,sha256=-YqCLGDh4ezF149xB3dfuUAQotKAklZwYp0BL3HhA90,2256
15
14
  qbraid_cli/configure/__init__.py,sha256=YaJ74Ztz2vl3eYp8_jVBucWkXscxz7EZEIzr70OfuOM,187
16
- qbraid_cli/configure/actions.py,sha256=VZ7uP4bFE5ks9yH5xZYzllAm4rM0grV70CP2GbXiwrY,3589
15
+ qbraid_cli/configure/actions.py,sha256=Zv-y7iGgj1fwYceMSXrurpK2PyFCIitKXPqCb4H9AZo,3818
17
16
  qbraid_cli/configure/app.py,sha256=7UN8Bje0n_s2nDE-cHid8VwOp7gl0jjw9gldyCcZNhI,4164
18
17
  qbraid_cli/devices/__init__.py,sha256=hiScO-px6jCL5cJj5Hbty55EUfNejTO4bmqUZuS3aqc,181
19
- qbraid_cli/devices/app.py,sha256=q8AQ8o05JXODsaFR_16_S3UtLWPzwC2qi0bVw2h7RJ8,2543
18
+ qbraid_cli/devices/app.py,sha256=B-cRdV092C6ACeu3C-5l2P_izpPDxvCzzAKfxO1WkaM,3224
20
19
  qbraid_cli/devices/validation.py,sha256=YhShyUufgrKnx2XjXOXF-PqFJYklJT9CgeqIwKcNam4,809
21
20
  qbraid_cli/envs/__init__.py,sha256=1-cMvrATsddYxcetPJWxq6bEOqJWMktGdhoZ4qm8euA,172
22
21
  qbraid_cli/envs/activate.py,sha256=VpvVYSfQDlcmlNWJOgkLIQ2p8YXPPLG8Jbl5t8GHUDw,2140
23
- qbraid_cli/envs/app.py,sha256=4Xdh7A2nAw5eUGJgTyTWssw39czwq6q6_iM5rGFxmm4,10158
22
+ qbraid_cli/envs/app.py,sha256=yDNipJuIM1RJHryoALLlRcxIVOpxWMHIy6O5BiR5wPU,10205
24
23
  qbraid_cli/envs/create.py,sha256=gF2wS09IYeQX71xLDabtLVgr_BxKLVP9Pt5XrNSRCS0,1052
25
24
  qbraid_cli/envs/data_handling.py,sha256=Ibnp2yJoUDpivb_sNqi0suYgJZNat_LmM6Ya0Ovez5s,1288
26
25
  qbraid_cli/files/__init__.py,sha256=3_yhgFoNcviEtS6B75uJBrfFFUjsrMcccCNEntJ54xU,175
27
- qbraid_cli/files/app.py,sha256=9PHYyrhZ84cVGQGCc6tmsS3yoPZL5jGzmf3j6H6vzU8,3771
26
+ qbraid_cli/files/app.py,sha256=gNa88cfAmpzYd9VOK7Q-OWJ1LyyHxq88PKhg8Q9w9Mk,3771
28
27
  qbraid_cli/jobs/__init__.py,sha256=qVLRHYIzP4XHpx_QWP_vCzd3LsCscCORaEx-Vcbx29U,172
29
- qbraid_cli/jobs/app.py,sha256=LnrxALu7OWSUg1FD6FvlGsILdoH46Y-ra12eiSfiMlE,4938
28
+ qbraid_cli/jobs/app.py,sha256=NchePouZkoHWxqV1lwiYuXwrLeP99zITKz5Ezc1pm2I,5383
30
29
  qbraid_cli/jobs/toggle_braket.py,sha256=3AEu-Z5q4avduB-fJMyMTVTuyZXuA8m-hnvi325wIv4,7444
31
30
  qbraid_cli/jobs/validation.py,sha256=KlkqVH1-vlNCHSayEpxzyXU86_TMN5prGfMFEoyBsFs,2971
32
31
  qbraid_cli/kernels/__init__.py,sha256=jORS9vV17s5laQyq8gSVB18EPBImgEIbMZ1wKC094DA,181
@@ -34,9 +33,9 @@ qbraid_cli/kernels/app.py,sha256=n-iyWJHy7_ML6qk4pp-v_rQkGA7WfnZMG8gyiCFGO1c,294
34
33
  qbraid_cli/pip/__init__.py,sha256=tJtU0rxn-ODogNh5Y4pp_BgDQXMN-3JY1QGj0OZHwjQ,169
35
34
  qbraid_cli/pip/app.py,sha256=jkk-djductrDOJIRYfHK_7WDJ12f0zOT3MMkiZp97oM,1365
36
35
  qbraid_cli/pip/hooks.py,sha256=jkIeev3cOd-cmaoJSdSqbmhTYCs6z1we84FMqa3ZoZw,2124
37
- qbraid_cli-0.10.6.dist-info/licenses/LICENSE,sha256=3KvWfsaXBCqbZ4qwk5jN9CQXE53tQeaZTySN5a-CCgQ,2753
38
- qbraid_cli-0.10.6.dist-info/METADATA,sha256=oPGqYzy4DA1d7HTgZqa9bEzg0SKC-XeP9u2sP7yEiD4,7621
39
- qbraid_cli-0.10.6.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
40
- qbraid_cli-0.10.6.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
41
- qbraid_cli-0.10.6.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
42
- qbraid_cli-0.10.6.dist-info/RECORD,,
36
+ qbraid_cli-0.10.8.dist-info/licenses/LICENSE,sha256=3KvWfsaXBCqbZ4qwk5jN9CQXE53tQeaZTySN5a-CCgQ,2753
37
+ qbraid_cli-0.10.8.dist-info/METADATA,sha256=Qtljnwex-xj0pdU4kWTz9Y3r5GE1m4qR1sRL7-dl8Wk,7628
38
+ qbraid_cli-0.10.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
+ qbraid_cli-0.10.8.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
40
+ qbraid_cli-0.10.8.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
41
+ qbraid_cli-0.10.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
qbraid_cli/_version.py DELETED
@@ -1,21 +0,0 @@
1
- # file generated by setuptools-scm
2
- # don't change, don't track in version control
3
-
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
-
6
- TYPE_CHECKING = False
7
- if TYPE_CHECKING:
8
- from typing import Tuple
9
- from typing import Union
10
-
11
- VERSION_TUPLE = Tuple[Union[int, str], ...]
12
- else:
13
- VERSION_TUPLE = object
14
-
15
- version: str
16
- __version__: str
17
- __version_tuple__: VERSION_TUPLE
18
- version_tuple: VERSION_TUPLE
19
-
20
- __version__ = version = '0.10.6'
21
- __version_tuple__ = version_tuple = (0, 10, 6)