Skip to main content

Getting Started with Upvest Investment API

Introduction

Upvest Investment API.

Install the Package

The package is compatible with Python versions 3.7+. Install the package from PyPi using the following pip command:

pip install uv-apimatic-sdk==0.0.1

You can also view the package at: https://pypi.python.org/pypi/uv-apimatic-sdk/0.0.1

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
environment Environment The API environment.
Default: Environment.PRODUCTION
http_client_instance Union[Session, HttpClientProvider] The Http Client passed from the sdk user for making requests
override_http_client_configuration bool The value which determines to override properties of the passed Http Client from the sdk user
http_call_back HttpCallBack The callback value that is invoked before and after an HTTP call is made to an endpoint
timeout float The value to use for connection timeout.
Default: 30
max_retries int The number of times to retry an endpoint call if it fails.
Default: 0
backoff_factor float A backoff factor to apply between attempts after the second try.
Default: 2
retry_statuses Array of int The http statuses on which retry is to be done.
Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]
retry_methods Array of string The http methods on which retry is to be done.
Default: ["GET", "PUT", "GET", "PUT"]
proxy_settings ProxySettings Optional proxy configuration to route HTTP requests through a proxy server.
logging_configuration LoggingConfiguration The SDK logging configuration for API calls
client_credentials_auth_credentials ClientCredentialsAuthCredentials The credential object for OAuth 2 Client Credentials Grant
http_signature_credentials HttpSignatureCredentials The key material used to sign every request with an HTTP message signature

The API client can be initialized as follows:

Code-Based Client Initialization

import logging

from upvestinvestmentapi.configuration import Environment
from upvestinvestmentapi.http.auth.oauth_2 import ClientCredentialsAuthCredentials
from upvestinvestmentapi.http.signature import HttpSignatureCredentials
from upvestinvestmentapi.logging.configuration.api_logging_configuration import LoggingConfiguration
from upvestinvestmentapi.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from upvestinvestmentapi.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
from upvestinvestmentapi.models.oauth_scope import OauthScope
from upvestinvestmentapi.upvestinvestmentapi_client import UpvestinvestmentapiClient

client = UpvestinvestmentapiClient(
    client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
        oauth_client_id='OAuthClientId',
        oauth_client_secret='OAuthClientSecret',
        oauth_scopes=[
            OauthScope.ACCOUNTSREAD,
            OauthScope.ACCOUNTSADMIN
        ]
    ),
    http_signature_credentials=HttpSignatureCredentials(
        key_id='KeyId',
        private_key_file='/path/to/upvest-http-sign-key.pem',
        private_key_passphrase='PrivateKeyPassphrase'
    ),
    environment=Environment.PRODUCTION,
    logging_configuration=LoggingConfiguration(
        log_level=logging.INFO,
        request_logging_config=RequestLoggingConfiguration(
            log_body=True
        ),
        response_logging_config=ResponseLoggingConfiguration(
            log_headers=True
        )
    )
)

Environment-Based Client Initialization

from upvestinvestmentapi.upvestinvestmentapi_client import UpvestinvestmentapiClient

# Specify the path to your .env file if it’s located outside the project’s root directory.
client = UpvestinvestmentapiClient.from_environment(dotenv_path='/path/to/.env')

See the Environment-Based Client Initialization section for details.

Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

Fields

Name Description
PRODUCTION Default Sandbox environment
ENVIRONMENT2 Live environment

Authorization

This API uses the following authentication schemes.

HTTP Signatures

On top of the OAuth 2 token, every request to the Upvest Investment API has to carry a cryptographic signature. The SDK creates it for you once you pass http_signature_credentials to the client — see HTTP Signatures for details.

List of APIs

SDK Infrastructure

Configuration

HTTP

Utilities

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_apimatic_sdk-0.0.1.tar.gz (328.7 kB view details)

Uploaded Source

Built Distribution

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

uv_apimatic_sdk-0.0.1-py3-none-any.whl (899.0 kB view details)

Uploaded Python 3

File details

Details for the file uv_apimatic_sdk-0.0.1.tar.gz.

File metadata

  • Download URL: uv_apimatic_sdk-0.0.1.tar.gz
  • Upload date:
  • Size: 328.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.3 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

File hashes

Hashes for uv_apimatic_sdk-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8a047c72fc0c19cd7c0003bcff66207ffeddb7d09394d2a72abf0e65ce668ae5
MD5 08fb9cf61e3d6c14e9c347e6f6f013f8
BLAKE2b-256 99015df9bd0273bf26301ac651976f6b82906218d5f48b61c0a4c7de91894e42

See more details on using hashes here.

File details

Details for the file uv_apimatic_sdk-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: uv_apimatic_sdk-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 899.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.3 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

File hashes

Hashes for uv_apimatic_sdk-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d61ba99b3ac7c663fe81cd1682b92355c02a9179ee6368847aefb5dd21f3134
MD5 2edc16252166b4457d577462982ecbfe
BLAKE2b-256 ae2b3b5e49e8b8633f3b7bad83d609ccf33688ddcaaea95a9be5b4561be4a983

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

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