Metadata-Version: 2.4
Name: qubecore-client
Version: 1.0.8
Summary: QubeCore Client SDK
License: MIT License
        
        Copyright (c) 2026 QubeCore Project
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: click>=8.3.2
Requires-Dist: grpcio>=1.60.0
Requires-Dist: protobuf>=4.0.0
Requires-Dist: pydantic>=2.5.0
Provides-Extra: dev
Requires-Dist: grpcio-tools>=1.60.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# QubeCore-Client

Python client SDK for QubeCore — Quantum Computing Operating System.

## Overview

QubeCore Client provides a Python-friendly interface for communicating
with QubeCore Server over gRPC. QubeCli, QubeLab, and QubeGate all
depend on this package.

## Requirements

- Python 3.11+
- QubeCore Server

## Installation

```bash
pip install qubecore-client
```

## Quick Start

```python
from qubecore_client import QubeClient

client = QubeClient(address="localhost:50051")

# Submit a job
job_id = client.submit_gate_job(
    backend_name="backend1",
    gate_circuits=[
        "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\ncreg c[2];\nh q[0];\ncx q[0],q[1];\nmeasure q -> c;"
    ],
    shots=100,
)
print("job_id:", job_id)

# Check status
status = client.get_job_status(job_id)
print("status:", status["status"])

# Fetch result
result = client.get_job_result(job_id)
print("result:", result)

# Cancel job (only possible while status is PENDING)
message = client.cancel_job(job_id)
print("cancel:", message)
```

## CLI

### Version

```bash
qubecore -v
qubecore --version
```

### Server Configuration

```bash
qubecore config set host 192.168.1.100:50051
qubecore config get
```

### Commands

```bash
# Submit a job
qubecore submit --backend backend1 --circuit "OPENQASM 2.0;..." --shots 100

# Check status
qubecore status --job-id <job_id>

# Fetch result
qubecore result --job-id <job_id>

# Cancel job
qubecore cancel --job-id <job_id>
```

One-time server override:

```bash
qubecore --host 10.0.0.1:50051 submit --backend backend1 --circuit "..." --shots 100
```

## API

| Method | Description |
|--------|------|
| `submit_gate_job()` | Submits a gate-circuit execution job and returns a `job_id` |
| `get_job_status()` | Retrieves the current job status |
| `get_job_result()` | Retrieves the job result |
| `cancel_job()` | Cancels a job (only possible while status is PENDING) |

## `submit_gate_job` Parameters

| Parameter | Type | Required | Description |
|----------|------|------|------|
| `backend_name` | `str` | Yes | Backend name (`backend1`, `backend2`, `kreo.sc-20`) |
| `gate_circuits` | `list[str]` | Yes | List of circuit strings (QASM2/QASM3/JSON) |
| `shots` | `int` | Yes | Number of execution shots |
| `priority` | `int` | No | Priority from 1 to 4 (default: 3 = NORMAL) |
| `optimization_level` | `int` | No | Transpile optimization level from 0 to 3 (no default) |

## Compatibility

| qubecore-client | qubecore |
|----------------|----------|
| 1.x | 1.x |

## License

MIT