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.62
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| viqi_api-0.6.62-py3-none-any.whl | Python 3 | none | any | Details |
Release files / viqi_api-0.6.62-py3-none-any.whl
| Download URL | viqi_api-0.6.62-py3-none-any.whl |
|---|---|
| Size | 104.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec189cec129ea308d00e0c370547d0fd635d08994f2ff27725d9c165daa1dbc0
|
|
BLAKE2b-256 checksum How to use checksums |
9e02b83b36b0bde0e1edbe84bdf392a9c78bbceeab5f30ba226491f6d492b3d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for viqi-api 0.6.62
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.