Skip to main content

SDK for TopQAD

Project description

TopQAD SDK for Python

The code in this repository is intended to make access to the TopQAD platform as easy as writing Python!
This guide provides everything you need to set up your local development environment, run the demo script, and understand the core features of the SDK.


1. Development Setup

Follow these steps to set up a local environment for developing and testing the SDK.

a. Create and Activate a Virtual Environment

This creates an isolated Python environment for the project.

Open your terminal and navigate to the root directory of this project.

Create the virtual environment:
python3 -m venv .venv

Activate the environment:
macOS / Linux:
source .venv/bin/activate
Windows:
.\.venv\Scripts\activate

Your terminal prompt should now begin with (.venv).

Update pip:
python -m pip install -U pip


b. Install the Package in Editable Mode

This project uses pyproject.toml to manage dependencies. The following command will install the SDK in editable mode (-e) along with all development dependencies. This means any changes you make to the source code are immediately reflected in your environment.

pip install -e .


c. Get Your Refresh Token (Required for Authentication)

To use the SDK, you need a TOPQAD_REFRESH_TOKEN from the TopQAD portal.

  1. Visit: https://portal.topqad.1qbit-dev.com/
  2. Go through the registration process and log in.
  3. Click your profile picture in the top right.
  4. Select "Get refresh token".
  5. Copy the token shown.

⚠️ Security Note: Your refresh token is as sensitive as a password. Keep it safe and never commit it to source control.

Set the environment variable in your shell or put it in .env file in root:
macOS / Linux:
export TOPQAD_REFRESH_TOKEN="<PASTE_YOUR_TOKEN_HERE>"
Windows:
set TOPQAD_REFRESH_TOKEN="<PASTE_YOUR_TOKEN_HERE>"


d. Verify the Installation

Run the following to check that the topqad-sdk package is installed, see its version, and confirm the installation path:

pip show topqad-sdk

2. Running the Interactive Demo

To see the SDK in action, we have prepared an interactive Jupyter Notebook that demonstrates the core functionality of the Noise Profiler.

To run the demo, open and run the notebook located at:

Noise_Profiler_Demo.ipynb

This notebook will guide you through setting your authentication token and running a simulation.


3. Logging Setup

The SDK supports two ways to configure logging:

  1. Using the TOPQAD_LOG_LEVEL Environment Variable: Set the desired logging level (e.g., INFO, DEBUG, WARNING) in your environment:

    export TOPQAD_LOG_LEVEL=DEBUG
    
  2. Programmatically in Your Code: You can configure the logging level directly in your Python script:

    import logging
    logging.getLogger("topqad_sdk").setLevel(logging.DEBUG)
    

By default, logging is disabled unless explicitly configured using one of the above methods.

License

This project is licensed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topqad_sdk-0.4.1.tar.gz (170.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topqad_sdk-0.4.1-py3-none-any.whl (138.6 kB view details)

Uploaded Python 3

File details

Details for the file topqad_sdk-0.4.1.tar.gz.

File metadata

  • Download URL: topqad_sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 170.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for topqad_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 caf987c653c0e115f70fe9f690b05bc11b4eb552ad4212b12aa9b90746ebf56b
MD5 dd3d9b81dd89a4bc419d2ca6950857f9
BLAKE2b-256 9a799684c291ff71259b7591e6703c8efb1b2bb85dece90c3bedc9bc716a15b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for topqad_sdk-0.4.1.tar.gz:

Publisher: publish_to_pypi.yml on 1QB-Information-Technologies/topqad-sdk-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file topqad_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: topqad_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 138.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for topqad_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2b5d6f6195ee0f0633be6e8911f709b750c7b8f5bde835849aa8bf6409e6fbe
MD5 f3a6680775f8ffee5a2efe70ec2abdfd
BLAKE2b-256 9ac81cb82b9c0c0952eb2e6e056af83e180e15cfc80787f765c055fcb5acbe63

See more details on using hashes here.

Provenance

The following attestation bundles were made for topqad_sdk-0.4.1-py3-none-any.whl:

Publisher: publish_to_pypi.yml on 1QB-Information-Technologies/topqad-sdk-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page