Skip to main content

ViQi API

Low level interface to ViQi services

Install

pip install viqi-api

Configuration

For command line tools create ~/.config/viqi/profiles or `~/config/viqi/profiles`` (windows) with the following

[default]
host=https://science.viqiai.cloud
user=myuser
password=mysecret

[science-user2]
host=https://science.viqiai.cloud
user=myuser2
password=mysecret2

# Admin can switch to another user
[science-secret-user]
host=https://science.viqiai.cloud
user=admin@viqi.org
password=admin_secret
alias=secret-user@viqi.org

Documentation

Usage & Initialization

The viqi_session helper provides a flexible way to initialize a session, whether from command line arguments, configuration files, or direct parameters in Python.

1. From Command Line Arguments (Scripts)

When used in a script without arguments, viqi_session() automatically parses sys.argv. This is the standard way to write scripts that can be configured via flags or config files.

myscript.py:

from vqapi import viqi_session
session = viqi_session()

if session:
    # Session is ready and connected
    print(f"Connected to {session.bqServer} as {session.user}")

    # Access services
    meta = session.service("meta")
    # ...

Run it:

# Using explicit credentials
python myscript.py --host https://science.viqiai.cloud --user myuser --password mysecret

# Using a profile defined in ~/.config/viqi/profiles
python myscript.py --profile default

2. From Python Parameters (Interactive/Library)

You can pass arguments directly as keyword arguments. This is useful for interactive sessions (like IPython/Jupyter) or when embedding the library.

from vqapi import viqi_session

# Using a profile defined in ~/.config/viqi/profiles
session = viqi_session(profile="science-user2")

# Using explicit credentials
session = viqi_session(
    host="https://science.viqiai.cloud",
    user="myuser",
    password="mysecret"
)

# Using an auth token
session = viqi_session(
    host="https://science.viqiai.cloud",
    authtoken="YOUR_AUTH_TOKEN"
)

3. Simulating Command Line Arguments

You can pass a list of strings to args to simulate command line input.

session = viqi_session(args=["--host", "https://science.viqiai.cloud", "--user", "admin", "--password", "secret"])

4. Custom Argument Parser

If your script requires its own custom arguments, you can extend the standard ViQi parser.

import argparse
from vqapi import viqi_session, viqi_argument_parser

# 1. Start with the standard ViQi parser
parser = viqi_argument_parser()

# 2. Add your custom arguments
parser.add_argument("--dataset-id", required=True, help="ID of dataset to process")

# 3. Parse args (handles both ViQi args and custom args)
args = parser.parse_args()

# 4. Initialize session using the parsed arguments
session = viqi_session(args=args)

# 5. Use your custom argument
print(f"Processing dataset: {args.dataset_id}")

Metadata

Release files for viqi-api 0.6.64

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for viqi-api 0.6.64
File Interpreter ABI Platform Actions
viqi_api-0.6.64-py3-none-any.whl Python 3 none any Details for viqi_api-0.6.64-py3-none-any.whl

Release files / viqi_api-0.6.64-py3-none-any.whl

Download URL viqi_api-0.6.64-py3-none-any.whl
Size 105.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d0998835d4d06ed3321a4d4ddc2301715e5b7bbd52fd1c6ad4d5d33fa0b1d13
BLAKE2b-256 checksum
How to use checksums
6c245970db46896d2c67c2aabab260ac2411aaae959941ebaf14580742f1a970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for viqi-api 0.6.64

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.64 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page