Skip to main content

Insighta Cloud SDK - API client and data models

Project description

insighta-sdk

Insighta Cloud SDK — API client and data models for portfolio management.

Installation

pip install insighta-sdk

Authentication

You can obtain an API key from the Developer tab at insight.cloud/settings.

Save the key in a credentials.yaml file:

api_key: "your-api-key-here"
endpoint: "https://openapi.insighta.cloud"

Load it in your code:

from insighta_sdk import Credentials

creds = Credentials.from_file("credentials.yaml")

Quick Start

from insighta_sdk import Credentials, InsightaClient

creds = Credentials.from_file("credentials.yaml")
client = InsightaClient(creds)

# List portfolios
portfolios = client.get_portfolios()

# Create a portfolio
from insighta_sdk import UploadConfig
config = UploadConfig.from_file("upload.yaml")
portfolio_id = client.create_portfolio(config)

Features

  • API Client — Full coverage of Insighta OpenAPI (portfolios, orders, metrics)
  • Data ModelsTrade, Holding, Deposit, OrderGroup, CashDeposit, RateEntry
  • Utilities — Rate lookup, order grouping, deposit merging
  • Workspace ManagementDirs class for consistent file path resolution

API Reference

Client

Method Description
create_portfolio(config) Create a new portfolio
get_portfolios() List own portfolios
search_portfolios(...) Search public portfolios
delete_portfolio(id) Delete a portfolio
send_order(portfolio_id, group, currency) Submit an order group
get_nav_history(id) Get NAV history
get_metrics_history(id, ...) Get metrics (TWR, etc.)

Utilities

Function Description
load_order_groups(path) Parse order.csv into OrderGroup list
load_cash_deposits(path) Parse cash_deposits.csv
merge_and_sort_groups(orders, deposits, memos) Merge and sequence order groups
load_rate_file(path) Load exchange rate CSV
lookup_rate(entries, dt, cur, base) Find applicable rate for a trade
fetch_ticker_info(tickers) Query ticker metadata from API

API Endpoint

Base URL: https://openapi.insighta.cloud

OpenAPI spec: insighta-app/openapi-docs/

Development

pip install -e .
pytest

See CONTRIBUTING.md for guidelines.

License

CC-BY-NC-4.0 — See LICENSE

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

insighta_sdk-0.1.3.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

insighta_sdk-0.1.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file insighta_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: insighta_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for insighta_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 da07e8a831d0c754b0b21af9188784df7383da0a2331160951a3803f3a2a5464
MD5 c34bce02c4f8ee07e79230ea5b439907
BLAKE2b-256 9a0c5be9420a10bbc2c62b26a622012c99d84f584a8393bde3f149adae6ab4bc

See more details on using hashes here.

File details

Details for the file insighta_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: insighta_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for insighta_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a54df92f03dd0c14372743c15414d19d788f03f27644b59a7ac420ece16a91f9
MD5 97610d959907716bf0dfb9beeb06a495
BLAKE2b-256 097ed38cfc6d86fde0f5012542455bf3b08aae21c4d60d79b1871f9d27118fc6

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