Installation

Get the VECU Custody Python SDK installed and configured in your project.

What This Section Covers

Step-by-step instructions for installing the SDK package from Cox Artifactory, configuring authentication, and verifying your installation.

Prerequisites

  • Python >= 3.11
  • pip, poetry, or uv package manager
  • Cox Automotive Artifactory access

Step 1: Configure Artifactory Authentication

The SDK is hosted in Cox Automotive's private Artifactory. Configure your package manager to access it.

Option A: pip Configuration

Create or update ~/.pip/pip.conf (Linux/macOS) or %APPDATA%\pip\pip.ini (Windows):

[global]
extra-index-url = https://cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple
trusted-host = cai.jfrog.io

For authenticated access, use environment variables:

export PIP_EXTRA_INDEX_URL="https://${ARTIFACTORY_USER}:${ARTIFACTORY_TOKEN}@cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple"

Option B: Poetry Configuration

Add the Artifactory source to your pyproject.toml:

[[tool.poetry.source]]
name = "artifactory"
url = "https://cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple"
priority = "supplemental"

Configure authentication:

poetry config http-basic.artifactory $ARTIFACTORY_USER $ARTIFACTORY_TOKEN

Option C: uv Configuration

Use the --extra-index-url flag or set the environment variable:

export UV_EXTRA_INDEX_URL="https://cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple"

Step 2: Install the SDK

bash pip install vecu-custody-python-sdk

Step 3: Install Optional Dependencies

The SDK has optional dependencies for specific features:

# Async support (httpx for async HTTP client)
pip install vecu-custody-python-sdk[async]

# Development tools (testing utilities)
pip install vecu-custody-python-sdk[dev]

# All optional dependencies
pip install vecu-custody-python-sdk[all]

Step 4: Verify Installation

Test that the SDK is installed correctly:

import vecu_custody

# Check version
print(f"vecu-custody version: {vecu_custody.__version__}")

# Verify imports
from vecu_custody import CustodyClient
from vecu_custody.aio import AsyncCustodyClient
from vecu_custody.exceptions import CustodyError

print("SDK installed successfully!")

Run the verification:

python -c "import vecu_custody; print(f'Version: {vecu_custody.__version__}')"

Environment Variables

The SDK supports configuration via environment variables:

VariableDescriptionRequired
VECU_API_KEYYour JWT token for authYes
VECU_BASE_URLCustom API base URLNo
VECU_TIMEOUTRequest timeoutNo

Project Structure Example

A typical project setup:

my-project/
├── .env                    # Environment variables (not committed)
├── .env.example            # Example environment file
├── pyproject.toml          # Project dependencies
├── src/
│   └── custody_integration.py
└── tests/
    └── test_custody.py

Example .env file:

VECU_API_KEY=your-jwt-token

Example pyproject.toml:

[project]
name = "my-custody-app"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
    "vecu-custody-python-sdk>=0.1.0",
    "python-dotenv>=1.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.0.0",
    "pytest-asyncio>=0.23.0",
]

[[tool.poetry.source]]
name = "artifactory"
url = "https://cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple"
priority = "supplemental"

Troubleshooting

Package Not Found

If pip cannot find the package:

  1. Verify Artifactory URL is correct
  2. Check authentication credentials
  3. Ensure trusted-host is configured
# Test Artifactory access
pip index versions vecu-custody-python-sdk --index-url https://cai.jfrog.io/artifactory/api/pypi/pypi-release-local/simple

SSL Certificate Errors

If you encounter SSL errors:

# Add trusted host
pip install vecu-custody --trusted-host cai.jfrog.io

Import Errors

If imports fail after installation:

  1. Verify Python version: python --version (must be 3.11+)
  2. Check the package is in the correct environment
  3. Reinstall the package
pip uninstall vecu-custody-python-sdk
pip install vecu-custody-python-sdk --force-reinstall

Next Steps