Skip to main content

Python SDK for accessing the VELO API for climate risk data, asset information, companies, and market indexes

Project description

VELO Python SDK

The VELO Python SDK provides a streamlined interface for interacting with the VELO API, enabling businesses to access and analyze climate risk data for companies, assets, and market indexes.

For complete API documentation visit our API docs.

Installation

pip install keyring keyrings.google-artifactregistry-auth 
pip install velo-sdk --extra-index-url https://northamerica-northeast1-python.pkg.dev/earnest-math-277914/ecofusion-py/simple/

Requirements

  • Python 3.11 or higher

Authentication

The SDK requires an API key for authentication. You can pass your API key when initializing the client:

from velo_sdk.api import APIClient

client = APIClient(api_key="your-api-key")

If the api_key parameter is not provided, the API key will be inferred from the RISKTHINKING_API_KEY environment variable instead.

Features

Companies

Access company data including associated assets and market information:

# Get specific company data
company = client.companies.get_company("company-id")

# List companies with pagination
for company in client.companies.list_companies():
    print(company.name)

# Search for companies by name
results = client.companies.search_companies(name="Company Name")

# List assets owned by a company
for asset in client.companies.list_company_assets("company-id"):
    print(asset.name)

# Get climate scores for a company
scores = client.companies.get_company_climate_scores(
    "company-id", 
    pathway="SV", 
    horizon=2050
)

# Get impact scores aggregated by country
for country_score in client.companies.aggregate_company_asset_climate_scores_by_country(
    "company-id", 
    pathway="SV", 
    horizon=2050
):
    print(f"{country_score.country}: {country_score.dcr_score}")

Assets

Retrieve and analyze physical assets and their climate risk scores:

# Get asset details
asset = client.assets.get_asset("asset-id")

# List all assets with pagination
for asset in client.assets.list_assets():
    print(f"{asset.name} ({asset.asset_type})")

# Get the owner of an asset
owner = client.assets.get_asset_owner("asset-id")

Market Indexes

Access market indexes and associated climate risk analytics:

# List available market indexes
for index in client.markets.list_indexes():
    print(index.name)

# Get companies in a specific index
for company in client.markets.get_index_companies("index-id"):
    print(company.name)

# Get climate scores for an index
scores = client.markets.get_index_climate_scores(
    "index-id", 
    pathway="SV", 
    horizon=2050
)

# Get impact scores aggregated by country
for country_score in client.markets.aggregate_index_asset_climate_scores_by_country(
    "index-id", 
    pathway="SV", 
    horizon=2050
):
    print(f"{country_score.country}: {country_score.dcr_score}")

Direct API Access

For advanced use cases, you can make direct HTTP requests to any endpoint while still using your authentication credentials:

# Make a GET request with query parameters
response = client.get("/custom/endpoint", params={"param1": "value1"})

# Make a POST request with JSON body
response = client.post(
    "/custom/endpoint", 
    json={"key": "value"}
)

# Async API calls are also supported
async def make_request():
    response = await client.get_async("/custom/endpoint")
    print(response)

These methods (get, post, put, delete) and their async variants allow you to interact with any API endpoint not explicitly covered by the SDK's high-level methods.

Async Support

The SDK provides async versions of all API methods:

import asyncio
from velo_sdk.api import APIClient

async def main():
    client = APIClient(api_key="your-api-key")
    company = await client.companies.get_company_async("company-id")
    print(company.name)

asyncio.run(main())

Pagination

The SDK handles pagination automatically for list endpoints:

# Iterate through all results (automatically handles pagination)
for company in client.companies.list_companies():
    print(company.name)

Error Handling

The SDK provides clear error messages for API errors:

from velo_sdk.api import APIError

try:
    company = client.companies.get_company("non-existent-id")
except APIError as e:
    print(f"Error: {e.status_code} - {e.message}")

Support

For questions or support, please contact velo@riskthinking.ai.

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

velo_sdk-0.0.5.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

velo_sdk-0.0.5-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file velo_sdk-0.0.5.tar.gz.

File metadata

  • Download URL: velo_sdk-0.0.5.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for velo_sdk-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c358c406b788d25ba7a5ecd515295a1e99463cb7e77f49059fb630b2da230c43
MD5 73a11bab80c3f27e819532a92523e20d
BLAKE2b-256 71eccadaab406cc38d3bd6abc5dc017ca35ea6bf338f6efbe91b497c35db3f17

See more details on using hashes here.

File details

Details for the file velo_sdk-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: velo_sdk-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for velo_sdk-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0fdc30c492a3a6742f7dc05d01fbc06a858a36b1ded07adaa1afc994b668d1cd
MD5 5e0e083e5d869ff60bb64875eab3763d
BLAKE2b-256 9fb7ec69251ac4ae41982a4368f90695c3af7d0ecdae1943bd24cbc6c6cac50d

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