Skip to main content

Thin Python SDK for the VMX external API

Project description

vmodal Python SDK

Async-first Python SDK for the VMX external API. The SDK is distributed from GitHub under the MIT License; it is not published to PyPI.

Install

python -m pip install "git+https://github.com/v-modal/vmodal_sdk.git#subdirectory=sdk_python"

Upgrade or uninstall:

python -m pip install --upgrade "git+https://github.com/v-modal/vmodal_sdk.git#subdirectory=sdk_python"
python -m pip uninstall vmodal

For a reproducible deployment, replace the default branch with a release tag:

python -m pip install "git+https://github.com/v-modal/vmodal_sdk.git@TAG#subdirectory=sdk_python"

Configure authentication

Obtain an API key through your v-modal account administrator. API keys are Bearer credentials: keep them out of source control, rotate them in the account administration surface, and replace VMODAL_API_KEY after a rotation.

export VMODAL_API_KEY=ak_xxx

This is the complete public configuration. Client.from_env() and SyncClient.from_env() select the production gateway and call /api/v1/auth/me to derive and cache user_id, tenant_id, and email from the key.

An invalid or expired token raises AuthError with status 401. A valid token without the required permission raises ApiError with status 403. Rotate a token by replacing the environment value; the encrypted identity cache is token-scoped and stored in the operating system's user-cache directory.

The old VMODAL_API_TOKEN and TEST_CLIENT_* names remain private test-only compatibility aliases. They are not public configuration inputs.

Verify authentication

from vmodal import SyncClient

client = SyncClient.from_env()
print(client.auth())

Successful output:

VMODAL_API_KEY is valid, authenticated correctly (user_id=user_abc)

Examples

Use the SDK

import asyncio
from vmodal import Client, SyncClient

async def main():
    async with Client.from_env() as client:
        return await client.searches.search_video(
            query_text="example",
            mode="vid_file",
            group_name="agroup",
        )

asyncio.run(main())

client = SyncClient.from_env()
print(client.health())

CLI

vmodal health
vmodal search_video --query_text=example --group_name=agroup --mode=vid_file
python -m vmodal.cli video_upload --filepath_local=/path/to/video.mp4 --collection_name=agroup --sub_collection_name=astream

See the endpoint map, configuration reference, and support policy.

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

vmodal-0.1.0.tar.gz (74.1 kB view details)

Uploaded Source

Built Distribution

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

vmodal-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file vmodal-0.1.0.tar.gz.

File metadata

  • Download URL: vmodal-0.1.0.tar.gz
  • Upload date:
  • Size: 74.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for vmodal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6d4333f0c4a042155fc72faf52282b61f2b0a8e035cf175522aae478d25cb63a
MD5 5070782cc2292ed75ae74968cc76f95c
BLAKE2b-256 c9aaba491dc5e9b376c72288d440316d88622b3e11d1695b0b77218b8bf3082d

See more details on using hashes here.

File details

Details for the file vmodal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vmodal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for vmodal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d46d72796421779b0238f6e307de59b569ffe94345b78e2f5654eadd9ca61de0
MD5 bad6981f407496572f4a206d6151674b
BLAKE2b-256 5437c7a4e2ede0d319ae627b27892d5008b36c48809213261897618c1d979417

See more details on using hashes here.

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