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
- Access Tokens
- Webhook Subscriptions
- User Identifiers
- User Checks
- Tax Exemptions
- Tax Wrappers
- Account Groups
- Reference Accounts
- Direct Debits
- Credit Fundings
- Cash Balance Transfers
- Virtual Bank Accounts
- Cash Balances
- Price Data
- Tax Residencies
- Fees Configurations
- Transaction Fees Models
- Portfolios Rebalancing
- Virtual Cash Balances
- Savings Plans
- Securities Transfers
- Account Transfers
- ISA Transfers
- Business Checks
- Files
- Users
- Accounts
- Mandates
- Top-Ups
- Withdrawals
- Instruments
- Orders
- Positions
- Reports
- Transactions
- Fees
- Portfolios
- Valuations
- Liquidations
- Returns
- Tests
- Businesses
- Roles
SDK Infrastructure
Configuration
- ProxySettings
- Environment-Based Client Initialization
- AbstractLogger
- LoggingConfiguration
- RequestLoggingConfiguration
- ResponseLoggingConfiguration
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a047c72fc0c19cd7c0003bcff66207ffeddb7d09394d2a72abf0e65ce668ae5
|
|
| MD5 |
08fb9cf61e3d6c14e9c347e6f6f013f8
|
|
| BLAKE2b-256 |
99015df9bd0273bf26301ac651976f6b82906218d5f48b61c0a4c7de91894e42
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d61ba99b3ac7c663fe81cd1682b92355c02a9179ee6368847aefb5dd21f3134
|
|
| MD5 |
2edc16252166b4457d577462982ecbfe
|
|
| BLAKE2b-256 |
ae2b3b5e49e8b8633f3b7bad83d609ccf33688ddcaaea95a9be5b4561be4a983
|