qbraid-cli 0.8.7__py3-none-any.whl → 0.9.0a0__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/_version.py +2 -2
- qbraid_cli/account/__init__.py +11 -0
- qbraid_cli/account/app.py +65 -0
- qbraid_cli/main.py +16 -8
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/METADATA +5 -4
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/RECORD +10 -10
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/WHEEL +1 -1
- qbraid_cli/credits/__init__.py +0 -11
- qbraid_cli/credits/app.py +0 -35
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/LICENSE +0 -0
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/entry_points.txt +0 -0
- {qbraid_cli-0.8.7.dist-info → qbraid_cli-0.9.0a0.dist-info}/top_level.txt +0 -0
qbraid_cli/_version.py
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module defining commands in the 'qbraid user' namespace.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
import rich
|
|
12
|
+
import typer
|
|
13
|
+
|
|
14
|
+
from qbraid_cli.handlers import run_progress_task
|
|
15
|
+
|
|
16
|
+
account_app = typer.Typer(help="Manage qBraid account.")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@account_app.command(name="credits")
|
|
20
|
+
def account_credits():
|
|
21
|
+
"""Get number of qBraid credits remaining."""
|
|
22
|
+
|
|
23
|
+
def get_credits() -> float:
|
|
24
|
+
from qbraid_core import QbraidClient
|
|
25
|
+
|
|
26
|
+
client = QbraidClient()
|
|
27
|
+
return client.user_credits_value()
|
|
28
|
+
|
|
29
|
+
qbraid_credits: float = run_progress_task(get_credits)
|
|
30
|
+
typer.secho(
|
|
31
|
+
f"\n{typer.style('qBraid credits remaining:')} "
|
|
32
|
+
f"{typer.style(f'{qbraid_credits:.4f}', fg=typer.colors.MAGENTA, bold=True)}",
|
|
33
|
+
nl=True, # Ensure a newline after output (default is True)
|
|
34
|
+
)
|
|
35
|
+
rich.print("\nFor more information, visit: https://docs.qbraid.com/home/pricing#credits")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@account_app.command(name="info")
|
|
39
|
+
def account_info():
|
|
40
|
+
"""Get qBraid account (user) metadata."""
|
|
41
|
+
|
|
42
|
+
def get_user() -> dict[str, Any]:
|
|
43
|
+
from qbraid_core import QbraidSession
|
|
44
|
+
|
|
45
|
+
session = QbraidSession()
|
|
46
|
+
user = session.get_user()
|
|
47
|
+
personal_info: dict = user.get("personalInformation", {})
|
|
48
|
+
metadata = {
|
|
49
|
+
"_id": user.get("_id"),
|
|
50
|
+
"userName": user.get("userName"),
|
|
51
|
+
"email": user.get("email"),
|
|
52
|
+
"joinedDate": user.get("createdAt", "Unknown"),
|
|
53
|
+
"activePlan": user.get("activePlan", "") or "Free",
|
|
54
|
+
"organization": personal_info.get("organization", "") or "qbraid",
|
|
55
|
+
"role": personal_info.get("role", "") or "guest",
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return metadata
|
|
59
|
+
|
|
60
|
+
info = run_progress_task(get_user)
|
|
61
|
+
rich.print(info)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if __name__ == "__main__":
|
|
65
|
+
account_app()
|
qbraid_cli/main.py
CHANGED
|
@@ -8,25 +8,33 @@ Entrypoint for the qBraid CLI.
|
|
|
8
8
|
|
|
9
9
|
import typer
|
|
10
10
|
|
|
11
|
+
from qbraid_cli.account.app import account_app
|
|
11
12
|
from qbraid_cli.admin.app import admin_app
|
|
12
13
|
from qbraid_cli.configure.app import configure_app
|
|
13
|
-
from qbraid_cli.credits.app import credits_app
|
|
14
14
|
from qbraid_cli.devices.app import devices_app
|
|
15
|
-
from qbraid_cli.envs.app import envs_app
|
|
16
15
|
from qbraid_cli.jobs.app import jobs_app
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
from qbraid_cli.envs.app import envs_app
|
|
19
|
+
from qbraid_cli.kernels.app import kernels_app
|
|
20
|
+
from qbraid_cli.pip.app import pip_app
|
|
21
|
+
|
|
22
|
+
ENVS_COMMANDS = True
|
|
23
|
+
except ImportError:
|
|
24
|
+
ENVS_COMMANDS = False
|
|
19
25
|
|
|
20
26
|
app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})
|
|
21
27
|
|
|
22
28
|
app.add_typer(admin_app, name="admin")
|
|
23
29
|
app.add_typer(configure_app, name="configure")
|
|
24
|
-
app.add_typer(
|
|
30
|
+
app.add_typer(account_app, name="account")
|
|
25
31
|
app.add_typer(devices_app, name="devices")
|
|
26
|
-
app.add_typer(envs_app, name="envs")
|
|
27
32
|
app.add_typer(jobs_app, name="jobs")
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
|
|
34
|
+
if ENVS_COMMANDS is True:
|
|
35
|
+
app.add_typer(envs_app, name="envs")
|
|
36
|
+
app.add_typer(kernels_app, name="kernels")
|
|
37
|
+
app.add_typer(pip_app, name="pip")
|
|
30
38
|
|
|
31
39
|
|
|
32
40
|
def version_callback(value: bool):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0a0
|
|
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,13 +29,14 @@ 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: qbraid-core
|
|
32
|
+
Requires-Dist: qbraid-core>=0.1.28
|
|
33
33
|
Provides-Extra: dev
|
|
34
|
-
Requires-Dist: ruff; extra == "dev"
|
|
35
34
|
Requires-Dist: isort; extra == "dev"
|
|
36
35
|
Requires-Dist: black; extra == "dev"
|
|
37
36
|
Requires-Dist: pytest; extra == "dev"
|
|
38
37
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
38
|
+
Provides-Extra: envs
|
|
39
|
+
Requires-Dist: qbraid-core[environments]; extra == "envs"
|
|
39
40
|
Provides-Extra: jobs
|
|
40
41
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
41
42
|
|
|
@@ -141,7 +142,7 @@ Options
|
|
|
141
142
|
|
|
142
143
|
Commands
|
|
143
144
|
configure Configure qBraid CLI options.
|
|
144
|
-
|
|
145
|
+
account Manage qBraid account.
|
|
145
146
|
devices Manage qBraid quantum devices.
|
|
146
147
|
envs Manage qBraid environments.
|
|
147
148
|
jobs Manage qBraid quantum jobs.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
qbraid_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
qbraid_cli/_version.py,sha256=
|
|
2
|
+
qbraid_cli/_version.py,sha256=HjY1UzcNtKKrJ8GVdemZ4PKAbhmYJUmCc4zQTJY4W0I,413
|
|
3
3
|
qbraid_cli/exceptions.py,sha256=KjlhYJhSHMVazaNiBjD_Ur06w4sekP8zRsFzBdyIpno,672
|
|
4
4
|
qbraid_cli/handlers.py,sha256=3RTG5FHL5GTyDoBUv81x5sLyqwf8nzkcqBi0k1ayoW8,7034
|
|
5
|
-
qbraid_cli/main.py,sha256=
|
|
5
|
+
qbraid_cli/main.py,sha256=wjfPLM4FKmvk4Y3xQ7wW12RmRKy9kMIkdVtRlw6Nrbg,2749
|
|
6
6
|
qbraid_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
qbraid_cli/account/__init__.py,sha256=smlpUcVkM3QEbJG0norGM7i71XBJlUGQYByswTfPnmg,181
|
|
8
|
+
qbraid_cli/account/app.py,sha256=-dVlAdGG0xKvjzk9248p3EcHnvKamVSmiZBW_xCMGII,1823
|
|
7
9
|
qbraid_cli/admin/__init__.py,sha256=qcWD5mQEUCtr49mrUpZmk7eGDe0L_Gtc8RwZmzIXSwo,175
|
|
8
10
|
qbraid_cli/admin/app.py,sha256=NGisg2aouk8qK2oFogwblFTBK0vvTiL_zJYjeanC4x0,1576
|
|
9
11
|
qbraid_cli/admin/headers.py,sha256=WqpRYp81CQcF5-Afumo_qQrf-5XCfbndBJ6I7vOADKE,7133
|
|
@@ -11,8 +13,6 @@ qbraid_cli/admin/validation.py,sha256=U_8RFWBwRUNPe6LdjNpl-Yz8Br57PLWMoPbpR-jBS-
|
|
|
11
13
|
qbraid_cli/configure/__init__.py,sha256=YaJ74Ztz2vl3eYp8_jVBucWkXscxz7EZEIzr70OfuOM,187
|
|
12
14
|
qbraid_cli/configure/actions.py,sha256=-BduRmnxvf8JMNonb6VWFtdlHlcHPOPz3Bj5g8kfmBU,3197
|
|
13
15
|
qbraid_cli/configure/app.py,sha256=1uRe2lkUA4TtYb5b4mbD4LH-cKCbsZGT3Wfk7fpNzX0,2414
|
|
14
|
-
qbraid_cli/credits/__init__.py,sha256=MJhgWgpFT1_886sB-_POlRs1y3SRy23HIrKVBkp0X-Y,181
|
|
15
|
-
qbraid_cli/credits/app.py,sha256=AY3qtveO50KeQ2XREiEVqUcTrESgRuoqt9pt2Z8t4Y0,866
|
|
16
16
|
qbraid_cli/devices/__init__.py,sha256=hiScO-px6jCL5cJj5Hbty55EUfNejTO4bmqUZuS3aqc,181
|
|
17
17
|
qbraid_cli/devices/app.py,sha256=3Ly5PPNVhipzbX2h3FrB3fWawLbUcQFcUqv_cZv5eYk,2523
|
|
18
18
|
qbraid_cli/devices/validation.py,sha256=YhShyUufgrKnx2XjXOXF-PqFJYklJT9CgeqIwKcNam4,809
|
|
@@ -30,9 +30,9 @@ qbraid_cli/kernels/app.py,sha256=Sl57U1JXDKWoeMQDSXJRHlKzDYSdKIbV7tSytZXo5PM,292
|
|
|
30
30
|
qbraid_cli/pip/__init__.py,sha256=tJtU0rxn-ODogNh5Y4pp_BgDQXMN-3JY1QGj0OZHwjQ,169
|
|
31
31
|
qbraid_cli/pip/app.py,sha256=wzvjX5NL37XIFtZ5KvTZ-nj9xwFKt8QLYZ_vGvk3tXo,1440
|
|
32
32
|
qbraid_cli/pip/hooks.py,sha256=jkIeev3cOd-cmaoJSdSqbmhTYCs6z1we84FMqa3ZoZw,2124
|
|
33
|
-
qbraid_cli-0.
|
|
34
|
-
qbraid_cli-0.
|
|
35
|
-
qbraid_cli-0.
|
|
36
|
-
qbraid_cli-0.
|
|
37
|
-
qbraid_cli-0.
|
|
38
|
-
qbraid_cli-0.
|
|
33
|
+
qbraid_cli-0.9.0a0.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
|
|
34
|
+
qbraid_cli-0.9.0a0.dist-info/METADATA,sha256=YM5B8T3TY-xOKLffoclGkb89xsbrGUnB60T-b7ZSono,6787
|
|
35
|
+
qbraid_cli-0.9.0a0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
36
|
+
qbraid_cli-0.9.0a0.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
|
|
37
|
+
qbraid_cli-0.9.0a0.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
|
|
38
|
+
qbraid_cli-0.9.0a0.dist-info/RECORD,,
|
qbraid_cli/credits/__init__.py
DELETED
qbraid_cli/credits/app.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
-
# All rights reserved.
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
Module defining commands in the 'qbraid credits' namespace.
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import typer
|
|
10
|
-
|
|
11
|
-
from qbraid_cli.handlers import run_progress_task
|
|
12
|
-
|
|
13
|
-
credits_app = typer.Typer(help="Manage qBraid credits.")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@credits_app.command(name="value")
|
|
17
|
-
def credits_value():
|
|
18
|
-
"""Get number of qBraid credits remaining."""
|
|
19
|
-
|
|
20
|
-
def get_credits() -> float:
|
|
21
|
-
from qbraid_core import QbraidClient
|
|
22
|
-
|
|
23
|
-
client = QbraidClient()
|
|
24
|
-
return client.user_credits_value()
|
|
25
|
-
|
|
26
|
-
qbraid_credits: float = run_progress_task(get_credits)
|
|
27
|
-
typer.secho(
|
|
28
|
-
f"\n{typer.style('qBraid credits remaining:')} "
|
|
29
|
-
f"{typer.style(f'{qbraid_credits:.4f}', fg=typer.colors.MAGENTA, bold=True)}",
|
|
30
|
-
nl=True, # Ensure a newline after output (default is True)
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if __name__ == "__main__":
|
|
35
|
-
credits_app()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|