Metadata-Version: 2.4
Name: qbraid-core
Version: 0.3.1
Summary: Python library with core abstractions for software development in the qBraid ecosystem.
Author: qBraid Development Team
Author-email: contact@qbraid.com
License: Proprietary
Project-URL: Homepage, https://sdk.qbraid.com/qbraid-core/
Project-URL: Documentation, https://docs.qbraid.com/v2/core
Project-URL: Bug Tracker, https://github.com/qBraid/community/issues
Project-URL: Discord, https://discord.gg/KugF6Cnncm
Keywords: qbraid,quantum,cloud
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: urllib3
Requires-Dist: packaging
Requires-Dist: pydantic>2.0.0
Provides-Extra: runner
Requires-Dist: numpy; extra == "runner"
Requires-Dist: psutil; extra == "runner"
Provides-Extra: compute
Requires-Dist: websockets>=11.0; extra == "compute"
Provides-Extra: environments
Requires-Dist: jupyter_client>=7.1.0; extra == "environments"
Requires-Dist: ipython; extra == "environments"
Requires-Dist: ipykernel; extra == "environments"
Requires-Dist: pyyaml>6.0.0; extra == "environments"
Requires-Dist: zstandard; extra == "environments"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx<8.3.0,>=7.2.6; extra == "docs"
Requires-Dist: sphinx-rtd-theme<3.1,>=1.3; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints<3.2,>=1.24; extra == "docs"
Requires-Dist: docutils<0.23; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-pydantic; extra == "docs"
Dynamic: license-file

# qbraid-core

[![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://qbraid.github.io/qbraid-core/)
[![codecov](https://codecov.io/gh/qBraid/qbraid-core/graph/badge.svg?token=vnZxySTsW2)](https://codecov.io/gh/qBraid/qbraid-core)
[![PyPI version](https://img.shields.io/pypi/v/qbraid-core.svg?color=blue)](https://pypi.org/project/qbraid-core/)
[![Python verions](https://img.shields.io/pypi/pyversions/qbraid-core.svg?color=blue)](https://pypi.org/project/qbraid-core/)
[![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/community/issues)

Python library providing core abstractions for software development within the qBraid ecosystem, and a low-level interface to a growing array of qBraid cloud services. The qbraid-core package forms the foundational base for the [qBraid CLI](https://pypi.org/project/qbraid-cli/), the [qBraid SDK](https://pypi.org/project/qbraid/), and [qBraid Lab](https://docs.qbraid.com/v2/lab/user-guide/overview).

You can find the latest, most up to date, documentation [here](https://qbraid.github.io/qbraid-core/), including a list of services that are supported.

*See also*: [`qbraid-core-js`](https://qbraid.github.io/qbraid-core-js/)

## Getting Started

You can install qbraid-core from PyPI with:

```bash
python -m pip install qbraid-core
```

### Local configuration

After installing qbraid-core, you must configure your account credentials:

1. Create a qBraid account or log in to your existing account by visiting
   [account.qbraid.com](https://account.qbraid.com/)
2. Navigate to **Account** > **API Keys** in the left-sidebar, and then click "Create API Key". See [API Key docs](https://docs.qbraid.com/v2/home/account#api-keys).
3. Save your API key from step 2 in local [configuration file](https://docs.qbraid.com/v2/cli/user-guide/config-files). On Linux and macOS, this file is located at `~/.qbraid/qbraidrc`, where `~` corresponds to your home (`$HOME`) directory. On Windows, the equivalent default location is `%USERPROFILE%\.qbraid\qbraidrc`.

```ini
[default]
api-key = YOUR_KEY
url = https://api-v2.qbraid.com/api/v1
```

Or generate your `~/.qbraid/qbraidrc` file via the qbraid-core Python interface:

```python
>>> from qbraid_core import QbraidSessionV1
>>> session = QbraidSessionV1(api_key='API_KEY')
>>> session.save_config()
>>> session.get_available_services()
['agents', 'compute', 'environments', 'projects', 'runtime', 'skills', 'storage']
```

Other credential configuration methods are available using the [qBraid-CLI](https://docs.qbraid.com/v2/cli/api-reference/qbraid_configure).

### Verify setup

After configuring your qBraid credentials, verify your setup by running the following from a Python interpreter:

```python
>>> import qbraid_core
>>> quantum_runtime_client = qbraid_core.client('runtime')
>>> devices = quantum_runtime_client.list_devices()
>>> for device in devices:
...     print(device.qrn, device.status)
```

## Community

- For feature requests and bug reports: [Submit an issue](https://github.com/qBraid/community/issues)
- For discussions and/or specific questions about qBraid services, [join our discord community](https://discord.gg/KugF6Cnncm)
- For questions that are more suited for a forum, post to [Stack Overflow](https://stackoverflow.com/) with the [`qbraid`](https://stackoverflow.com/questions/tagged/qbraid) tag.
