API
Deprecated
This module is not recommended for new projects. We recommend using the Everysk SDK instead.
The Everysk API Python module is a wrapper around the Everysk REST API. It provides a set of classes and methods that map directly to the REST endpoints, allowing you to interact with the API using familiar Python patterns.
Installation¶
To install the Everysk library, use pip:
Authentication¶
Authenticate by setting your Account SID and Auth Token on the everysk module before making any API calls:
import everysk.api as everysk
from everysk.config import settings
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
You can manage your API keys in the API Settings. Keep your Account SID and Auth Token secret.
Pagination¶
List methods support pagination via page_size and page_token. For convenience, all listable resources also expose auto_paging_iter(), which automatically fetches subsequent pages:
import everysk.api as everysk
from everysk.config import settings
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
for portfolio in everysk.Portfolio.auto_paging_iter(page_size=3):
# Do something with portfolio
pass
Calculation¶
Endpoints
POST /calculations/bond_pricer
POST /calculations/days_to_unwind
POST /calculations/exposure
POST /calculations/marginal_tracking_error
POST /calculations/parametric_risk_attribution
POST /calculations/properties
POST /calculations/risk_attribution
POST /calculations/sensitivity
POST /calculations/stress_test
The Calculation API provides endpoints to perform portfolio stress tests, risk attribution, exposure, and sensitivity calculations. Monte Carlo with full revaluation as well as parametric endpoints are provided.
You can pass a portfolio_id for a calculation instead of providing securities directly.
Bond Pricer¶
Prices fixed income securities using mark-to-market (M2M) spreads provided by the user.
Method: everysk.Calculation.bondPricer(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of fixed income security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Pricing date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
m2m_spreads object |
REQUIRED Object mapping security identifiers to their mark-to-market credit spreads. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.bondPricer(
id='port_123',
nlv=1234,
date='2025-04-07',
securities=[
{
'instrument_class': 'BrazilianFixedIncome',
'quantity': 1.0,
'id': 'sec_123',
'symbol': 'BRRF:KLBNA2 10405.8775',
'label': 'KLBNA2'
}
],
base_currency='BRL',
m2m_spreads={'BRRF:KLBNA2 10405.8775': 0.05}
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
Days to Unwind¶
Estimates the number of days required to fully liquidate each position given its size relative to the average daily trading volume.
Method: everysk.Calculation.daysToUnwind(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
days array |
REQUIRED Integer day thresholds (e.g. [1, 5, 10, 20]). |
liquidity_terms object |
optional ADTV and participation rate parameters per security group. |
filter string |
optional, default null Filter expression. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.daysToUnwind(
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
],
days=[1, 5, 10, 20],
date='20210622'
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"days_to_unwind": {
"unmapped_tickers": [],
"results": {
"id1": {
"dtu": 3,
"adtv": 75000000.0,
"buckets": [
{"days": 1, "value": 0.33},
{"days": 5, "value": 1.0},
{"days": 10, "value": 1.0},
{"days": 20, "value": 1.0}
]
}
}
}
}
Exposure¶
Calculates the delta-adjusted notional exposure of each security, converted to the base currency of the portfolio.
Method: everysk.Calculation.exposure(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default null (calculated) Net liquidating value (NAV). |
sampling integer |
optional, default 1 Historical sampling frequency. Accepts: 1 or 5. |
aggregation string |
optional, default position Aggregation criteria. |
filter string |
optional, default null Filter expression. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.exposure(
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
]
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"exposure": {
"unmapped_tickers": [],
"results": [
{
"notional": 133980.0,
"beta_notional": [
{"projection": "IND:SPX", "value": 144201.42194706676},
{"projection": "residual", "value": -10221.42194706676}
],
"id": "id1",
"notional_gross": 133980.0
},
{
"notional": 122421.00149999997,
"beta_notional": [
{"projection": "IND:SPX", "value": 127031.28308587175},
{"projection": "residual", "value": -4610.28158587178}
],
"id": "id2",
"notional_gross": 122421.00149999997
}
],
"nlv": 256401.00149999995
}
}
Tracking Errors¶
Tracking error is the divergence between the price behavior of a portfolio and the price behavior of a benchmark.
Method: everysk.Calculation.marginalTrackingError(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio1 string |
REQUIRED The portfolio to be analyzed. |
portfolio2 string |
REQUIRED The portfolio used as benchmark. |
weekly boolean |
optional, default True If True, uses weekly returns. |
EWMA boolean |
optional, default False If True, applies exponentially weighted moving average. |
exponential_decay float |
optional, default 0.94 EWMA weighting factor (0 to 1). Only used when EWMA is True. |
nDays integer |
optional, default 252 Business days used when weekly is False. |
nWeeks integer |
optional, default 200 Weeks used when weekly is True. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.marginalTrackingError(
portfolio_id1='port_tOeqCAgM02AdfNfoLaKynRvVw',
portfolio_id2='port_Ij8wTCniFM9sZKDB0HbigYidc',
weekly=False
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"marginal_tracking_error": {
"unmapped_tickers": [],
"results": {
"mcte": {
"ksav3g08": 0.011946318320363839
},
"te": 0.01731762913056002
}
}
}
Parametric Risk Attribution¶
Calculates the magnitude of a security's reaction to changes in underlying factors.
Method: everysk.Calculation.parametricRiskAttribution(**kwargs)
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED A string used to identify the portfolio. |
projection array |
REQUIRED Top-down factor model securities. Maximum 15 elements. |
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
use_cashflow boolean |
optional, default True For fixed income: maps each cashflow event to key rate curve points. |
sampling integer |
optional, default 1 Historical sampling frequency. Accepts: 1 or 5. |
confidence string |
optional, default 95% Confidence level for VaR/CVaR. |
historical_days integer |
optional, default 252 Business days for covariance calculation. |
exponential_decay float |
optional, default 0.94 EWMA factor (0 to 1). |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.parametricRiskAttribution(
projection=['IND:BVSP'],
securities=[
{'id': 'id1', 'symbol': 'PETR4:BVMF', 'quantity': 150.0},
],
base_currency='BRL',
date='20210711'
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"parametric_risk_attribution": {
"unmapped_tickers": [],
"results": {
"port_parametric_var": -705.5372072762883,
"port_parametric_vol": 428.93616533156944,
"sec_parametric_standalone_vol": {
"id1": 428.93616533156944
},
"..."
}
}
}
Properties¶
Calculates the overall portfolio properties with a single API call. Sensitivities, exposures, and risk measures are aggregated from individual securities to a portfolio level.
Method: everysk.Calculation.properties(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default null (calculated) Net liquidating value (NAV). |
horizon integer |
optional, default 5 Simulation horizon. Accepts: 1, 5, 20, 60. |
sampling integer |
optional, default 1 Historical sampling frequency. Accepts: 1 or 5. |
aggregation string |
optional, default position Aggregation criteria. |
projection array |
optional, default ["IND:SPX"] Top-down factor model securities. Maximum 10 elements. |
volatility_half_life integer |
optional, default 2 Volatility half life in months. |
correlation_half_life integer |
optional, default 6 Correlation half life in months. |
confidence string |
optional, default 95% Confidence level for CVaR. Accepts: 1sigma, 2sigma, 3sigma, 85%, 90%, 95%, 97%, 99%. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.properties(
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
],
date='20210622'
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"properties": {
"unmapped_tickers": [],
"results": [
{"value": 0.04480515690789044, "measure": "expected_return"},
{"value": 0.18968077675311104, "measure": "expected_volatility"},
{"value": -0.042711478991844576, "measure": "var"},
{"value": -0.0528583774329209, "measure": "cvar"},
{"value": 1.0, "measure": "net_exposure"},
{"value": 1.0, "measure": "gross_exposure"},
{"value": 256401.00149999995, "measure": "nlv"},
{"value": 0.0, "measure": "delta"},
{"value": 0.0, "measure": "duration"},
"..."
]
}
}
Monte Carlo Risk Attribution¶
The goal of Monte Carlo Risk Attribution is to calculate the contribution to the overall portfolio risk from each security, using Marginal Contribution to Total Risk (MCTR).
Method: everysk.Calculation.riskAttribution(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. When provided, uses the portfolio's securities, date, base currency, and nlv. |
securities array |
REQUIRED * Array of security objects (id, symbol, quantity, label). * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default null (calculated) Net liquidating value (NAV). |
horizon integer |
optional, default 5 Simulation horizon. Accepts: 1, 5, 20, 60. |
sampling integer |
optional, default 1 Historical sampling frequency. Accepts: 1 (daily) or 5 (weekly). |
aggregation string |
optional, default position Aggregation criteria: custom, position, country, sector, gics_sector, market_capitalization, liquidity, implied_rating, duration, security_type, security_type_refined, dividend_yield, exposure, currency, fixed_income, total_esg. |
projection array |
optional, default ["IND:SPX"] Top-down factor model securities. Maximum 15 elements. |
volatility_half_life integer |
optional, default 2 Volatility half life in months: 0, 2, 6, 12, 24, 48. |
correlation_half_life integer |
optional, default 6 Correlation half life in months: 0, 2, 6, 12, 24, 48. |
risk_measure string |
optional, default vol Risk measure for MCTR: vol, var, cvar. |
filter string |
optional, default null Filter expression to isolate a subset of the portfolio. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.riskAttribution(
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
],
date='20210622'
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"risk_attribution": {
"unmapped_tickers": [],
"results": [
{
"id": "id1",
"mctr": [
{"projection": "IND:SPX", "value": 0.0731895836099715},
{"projection": "residual", "value": 0.048455690761258066}
]
},
{
"id": "id2",
"mctr": [
{"projection": "IND:SPX", "value": 0.043270012765204605},
{"projection": "residual", "value": 0.024765489616676867}
]
}
]
}
}
Sensitivity¶
Calculates greeks for options and various fixed income sensitivities. Values can be unitized or weighted by the notional exposure of the security.
Method: everysk.Calculation.sensitivity(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
sensitivity_type string |
optional, default delta Accepts: delta, gamma, theta, vega, duration, effective_duration, macaulay_duration, modified_duration, cs01, dv01, average_life, rolled_average_life, volatility. |
compute_notional boolean |
optional, default False If True, weights sensitivities by notional exposure. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.sensitivity(
securities=[
{'id': 'id1', 'symbol': 'AAPL 20210629 P120 0.905', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'TWTR 20230120 C100.000 4.3', 'quantity': 750.0},
],
date='20210622'
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"sensitivity": {
"unmapped_tickers": [],
"sensitivity_type": "delta",
"results": {
"id2": 0.2714842229039089,
"id1": -0.12767219639181443
}
}
}
Stress Test¶
Stress Test calculates the expected behavior of the portfolio under different scenarios, including extreme events. Returns CVaR- (worst outcomes), EV (expected value), and CVaR+ (best outcomes).
Method: everysk.Calculation.stressTest(**kwargs)
Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional ID of an existing portfolio. |
securities array |
REQUIRED * Array of security objects. * Not required if portfolio_id is provided. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default null (calculated) Net liquidating value (NAV). |
horizon integer |
optional, default 5 Simulation horizon. Accepts: 1, 5, 20, 60. |
sampling integer |
optional, default 1 Historical sampling frequency. Accepts: 1 or 5. |
aggregation string |
optional, default position Aggregation criteria. |
projection array |
optional, default ["IND:SPX"] Top-down factor model securities. Maximum 15. |
volatility_half_life integer |
optional, default 2 Volatility half life in months. |
correlation_half_life integer |
optional, default 6 Correlation half life in months. |
shock string |
optional, default "IND:SPX" Security used for the stress test. |
magnitude float |
REQUIRED Magnitude of the shock as a decimal (e.g. -0.1 for -10%). |
confidence string |
optional, default "95%" Confidence level. Accepts: 1sigma, 2sigma, 3sigma, 85%, 90%, 95%, 97%, 99%. |
filter string |
optional, default null Filter expression. |
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Calculation.stressTest(
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
],
date='20210622',
projection=['SPY'],
shock='IND:SPX',
magnitude=-0.1
)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"stress_test": {
"extrapolated": false,
"out_of_range": false,
"implied_magnitudes": [-0.1],
"results": [
{
"ev": [
{"projection": "SPY", "value": -0.05381884985690465},
{"projection": "residual", "value": -0.00029460954393996727}
],
"cvar_neg": [
{"projection": "SPY", "value": -0.09483311872511944},
{"projection": "residual", "value": -0.024535867284700787}
],
"cvar_pos": [
{"projection": "SPY", "value": -0.009455158729183554},
{"projection": "residual", "value": 0.029583437854230045}
],
"id": "id2"
}
],
"dynamic_range": [-0.11251559173161693, 0.12721726088932167],
"unmapped_tickers": [],
"implied_horizon": 90
}
}
Custom Index¶
Endpoints
POST /custom_indexes
GET /custom_indexes
GET /custom_indexes/:id
PUT /custom_indexes/:id
DELETE /custom_indexes/:id
A custom index is a proprietary vector of date-value tuples representing a benchmark, risk factor, proxy, or any other measure. Custom indexes are not bound to a workspace. All symbols must follow the pattern CUSTOM:[A-Z_][A-Z0-9_].
Create a custom index¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.CustomIndex.create(
symbol='CUSTOM:AAPLBRL',
name='AAPL-BRL',
tags=['first', 'custom_index', '20210622'],
description='This is my first custom index',
currency='BRL',
date='20210622',
data=[
['20201209', 554.69],
['20190814', 985.45],
['20171012', 885.07],
]
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
symbol string |
REQUIRED Unique identifier. Must begin with CUSTOM: and have no spaces. |
name string |
REQUIRED A string to identify the custom index. |
data array |
REQUIRED Content to be stored as [["YYYYMMDD", value], ...]. |
description string |
optional, default null Detailed information. Supports hashtags. |
tags string |
optional, default null Tags for filtering. |
data_type string |
optional, default PRICE Type of data: PRICE, RETURN (decimal), or RETURN_100 (percentual). |
periodicity string |
optional, default D Data periodicity: D (daily) or M (monthly). |
currency string |
optional, default USD 3-letter ISO 4217 currency code. |
base_price float |
optional, default 1.0 Base price when data_type is RETURN or RETURN_100. |
List all custom indexes¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.CustomIndex.list(query='#20210622')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a custom index¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.CustomIndex.retrieve('CUSTOM:AAPLBRL')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
symbol string |
REQUIRED Custom index unique symbol (e.g. CUSTOM:AAPLBRL). |
Update a custom index¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.CustomIndex.modify(
'CUSTOM:AAPLBRL',
data=[
['20200622', 952.12],
['20200522', 953.06],
['20200421', 953.25],
],
description='My new custom index description',
data_type='PRICE',
periodicity='M'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED A string to identify the custom index. |
data array |
REQUIRED Content to be stored. |
description string |
optional, default null Detailed information. Supports hashtags. |
tags string |
optional, default null Tags for filtering. |
data_type string |
optional, default PRICE Type of data: PRICE, RETURN, or RETURN_100. |
periodicity string |
optional, default D Data periodicity: D or M. |
currency string |
optional, default USD 3-letter ISO 4217 currency code. |
base_price float |
optional, default 1.0 Base price when data_type is RETURN or RETURN_100. |
Delete a custom index¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.CustomIndex.remove('CUSTOM:AAPLBRL')
print(json.dumps(response, indent=2))
Returns:
Datastore¶
Endpoints
Datastores are fully integrated repositories to manage and persist data. The most common usage is the storage of securities as rows and related properties as columns.
Create a datastore¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Datastore.create(
name='My First Datastore',
tags=['first', 'datastore', '20210622'],
description='This is my first datastore',
date='20210622',
data=[
['MIC', 'SYMBOL', 'LATEST SECURITY DATE', 'LATEST SECURITY VALUE'],
['XKRX', '003550:XKRX', '20210429', 126500.0],
],
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED A string to identify the datastore. |
data array |
REQUIRED The content to be stored. |
description string |
optional, default null Detailed information. Supports hashtags. |
tags string |
optional, default null Tags for filtering. Do not use # prefix. |
date string |
optional, default null (today) Datastore date in format YYYYMMDD. |
with_data boolean |
optional, default True When True, returns data in the response. |
workspace string |
optional, default main Workspace to create the datastore in. |
List all datastores¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Datastore.list(query='#20210622', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a datastore¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Datastore.retrieve(
'dats_52KiJy2yFvosTtWM5aUJcOs1R',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Datastore unique identifier (e.g. dats_52KiJy2yFvosTtWM5aUJcOs1R). |
workspace string |
optional, default main Workspace to retrieve from. |
Update a datastore¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Datastore.modify(
'dats_52KiJy2yFvosTtWM5aUJcOs1R',
name='My New Datastore Name',
description='My new datastore description',
data=[
['MIC', 'SYMBOL', 'LATEST SECURITY DATE', 'LATEST SECURITY VALUE'],
['XLIF', 'CAM:XLIF', '20190211', 17.504],
],
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Datastore unique identifier. |
name string |
optional, default null Datastore name. |
description string |
optional, default null Detailed information. Supports hashtags. |
tags string |
optional, default null Tags for filtering. |
data array |
The content to be stored. |
workspace string |
optional, default main Workspace to update in. |
Delete a datastore¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Datastore.remove('dats_52KiJy2yFvosTtWM5aUJcOs1R', workspace='main')
print(json.dumps(response, indent=2))
Returns:
File¶
Endpoints
A file is a collection of data stored in one unit. File contents must be encoded in Base64 format.
Create a file¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.File.create(
name='My First File',
tags=['first', 'file', '20210622'],
description='This is my first stored file',
data='aGVsbG8gd29ybGQ=',
content_type='text/csv',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED A string to identify the file. |
description string |
REQUIRED Detailed information about the file. Supports hashtags. |
data string |
REQUIRED File content in Base64 format. |
content_type string |
REQUIRED File format (e.g. text/csv, application/json, image/png, application/pdf). |
tags string |
optional, default null Tags for filtering. |
with_data boolean |
optional, default True When True, returns file data in the response. |
workspace string |
optional, default main Workspace to create the file in. |
List all files¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.File.list(query='#20210622', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a file¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.File.retrieve(
'file_F6jkfLDarpyTQAJBjGwx9r2cl',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED File unique identifier (e.g. file_F6jkfLDarpyTQAJBjGwx9r2cl). |
workspace string |
optional, default main Workspace to retrieve from. |
Update a file¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.File.modify(
'file_F6jkfLDarpyTQAJBjGwx9r2cl',
name='UpdatedFile.csv',
description='My first file was updated',
data='aGVsbG8geW91IGFsbA==',
content_type='text/csv',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED A string to identify the file. |
description string |
REQUIRED Detailed information about the file. |
data string |
REQUIRED File content in Base64 format. |
content_type string |
REQUIRED File format. |
tags string |
optional, default null Tags for filtering. |
workspace string |
optional, default main Workspace to update in. |
Delete a file¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.File.remove('file_F6jkfLDarpyTQAJBjGwx9r2cl', workspace='main')
print(json.dumps(response, indent=2))
Returns:
Portfolio¶
Endpoints
A portfolio is a collection of financial investments. Each security can be traded in a specific local currency with a base currency reflecting FX risk.
Create a portfolio¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Portfolio.create(
name='My First Portfolio',
tags=['first', 'portfolio', '20210622'],
securities=[
{'id': 'id1', 'symbol': 'AAPL', 'quantity': 1000.0},
{'id': 'id2', 'symbol': 'SIE:XETR', 'quantity': 750.0},
],
workspace='main',
date='20210622'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED A mnemonic string to identify the portfolio. |
securities array |
REQUIRED Array of security objects (id, symbol, quantity). |
description string |
optional, default null Detailed information. Supports hashtags. |
date string date |
optional, default null (today) Portfolio date in format YYYYMMDD. |
base_currency string |
optional, default USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default null (calculated) Net liquidating value. |
with_securities boolean |
optional, default True When True, returns securities in the response. |
workspace string |
optional, default main Workspace to create the portfolio in. |
List all portfolios¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Portfolio.list(query='#20210622', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix (e.g. "#april #sample"). |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a portfolio¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Portfolio.retrieve(
'port_V7xU8dwCMnJIuyUPHJPx2ynuz',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Portfolio unique identifier (e.g. port_V7xU8dwCMnJIuyUPHJPx2ynuz). |
workspace string |
optional, default main Workspace to retrieve from. |
Update a portfolio¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Portfolio.modify(
'port_V7xU8dwCMnJIuyUPHJPx2ynuz',
name='New Portfolio Name',
description='New Portfolio Description',
securities=[
{'id': 'id3', 'symbol': 'NFLX', 'quantity': 500.0},
],
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Portfolio unique identifier. |
name string |
optional, default null Portfolio name. |
description string |
optional, default null Detailed information. Supports hashtags. |
base_currency string |
optional, default null 3-letter ISO 4217 currency code. |
securities array |
Array of security objects. |
workspace string |
optional, default main Workspace to update in. |
Delete a portfolio¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Portfolio.remove('port_V7xU8dwCMnJIuyUPHJPx2ynuz', workspace='main')
print(json.dumps(response, indent=2))
Returns:
Report¶
Endpoints
Interactive dashboards presenting portfolio analytics. Reports represent a specific portfolio and date for future reference.
List all reports¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Report.list(query='#20210622', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a report¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Report.retrieve(
'repo_N2wZOHGo5pbmhVwQT3UX2ifk4',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Report unique identifier (e.g. repo_N2wZOHGo5pbmhVwQT3UX2ifk4). |
workspace string |
optional, default main Workspace to retrieve from. |
Share a report¶
Generates a shareable URL for the report.
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Report.retrieve('repo_N2wZOHGo5pbmhVwQT3UX2ifk4', workspace='main').share()
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Report unique identifier. |
expires_after string |
optional, default 1 hour Time before the shared URL expires. |
skin_theme string |
optional, default Light Color theme of the shared report: Dark or Light. |
workspace string |
optional, default main Workspace the report belongs to. |
Delete a report¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Report.remove('repo_N2wZOHGo5pbmhVwQT3UX2ifk4', workspace='main')
print(json.dumps(response, indent=2))
Returns:
Report Template¶
Endpoints
A report template is a set of reporting widgets that calculate, visualize, and aggregate analytics based on a portfolio and/or datastores.
List all report templates¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.ReportTemplate.list(query='#first', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a report template¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.ReportTemplate.retrieve(
'rtpl_UHAo64xdlah3iR9lZgB6LFwAb',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Report template unique identifier (e.g. rtpl_UHAo64xdlah3iR9lZgB6LFwAb). |
workspace string |
optional, default main Workspace to retrieve from. |
Delete a report template¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.ReportTemplate.remove('rtpl_UHAo64xdlah3iR9lZgB6LFwAb', workspace='main')
print(json.dumps(response, indent=2))
Returns:
Workflow¶
Endpoints
A workflow is a collection of digital workers linked together to perform tasks in an automated fashion.
List all workflows¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workflow.list(query='#first', workspace='main')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter by name or tag. Tags require a # prefix. |
workspace string |
optional, default main Workspace to list from. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a workflow¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workflow.retrieve(
'wrkf_uylMWijKauV4B4Te7UJg9cNIv',
workspace='main'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Workflow unique identifier (e.g. wrkf_uylMWijKauV4B4Te7UJg9cNIv). |
workspace string |
optional, default main Workspace to retrieve from. |
Run a workflow¶
Triggers the execution of a workflow through the API.
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
params = {
'parameters': {
'file': {
'name': 'SimpleTextFile.txt',
'content_type': 'text/plain',
'data': 'SGVsbG8gV29ybGQ=',
}
}
}
response = everysk.Workflow.run('wrkf_P95OLO61oGM5NwFn3W4iMl7rs', workspace='main', **params)
print(json.dumps(response, indent=2))
The above call returns the following JSON object:
{
"workflow_execution": {
"status": "OK",
"started_worker_id": "wrkr_Sut4ZTaePs4PkdjDliVWYseGD",
"version": "v1",
"created": 1632835285,
"workflow_name": "File Generator Workflow",
"workflow_id": "wrkf_P95OLO61oGM5NwFn3W4iMl7rs",
"trigger": "API",
"id": "wfex_T1eYymTSIptJ4Hyt1Z6p4uGOe"
}
}
Parameters
| Parameter | Description |
|---|---|
id string |
REQUIRED Workflow unique identifier. |
workspace string |
optional, default main Workspace the workflow belongs to. |
parameters object |
REQUIRED Object containing inputs required by the workers inside the workflow. Pass an empty object if no inputs are needed. In Python, use as **kwargs. |
Delete a workflow¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workflow.remove('wrkf_uylMWijKauV4B4Te7UJg9cNIv', workspace='main')
print(json.dumps(response, indent=2))
Returns:
Workspace¶
Endpoints
A workspace is a grouping of all entities used inside the Everysk platform.
Create a workspace¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workspace.create(
name='sandbox',
description='This is my first workspace'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED Unique identifier for the workspace. No spaces allowed. |
description string |
optional, default null Detailed information about the workspace. Supports hashtags. |
List all workspaces¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workspace.list(query='sandbox')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
query string |
optional, default null Filter workspaces by name. |
page_size integer |
optional, default 10 Number of objects per page. |
page_token integer |
optional, default null Token defining which page to return. |
Retrieve a workspace¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workspace.retrieve('sandbox')
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED Unique identifier for the workspace. |
Update a workspace¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workspace.modify(
'sandbox',
description='My new workspace description'
)
print(json.dumps(response, indent=2))
Parameters
| Parameter | Description |
|---|---|
name string |
REQUIRED Unique identifier for the workspace. The workspace name cannot be changed. |
description string |
optional, default null Detailed information about the workspace. |
Delete a workspace¶
import everysk.api as everysk
from everysk.config import settings
import json
settings.EVERYSK_API_SID = 'YOUR_ACCOUNT_SID'
settings.EVERYSK_API_TOKEN = 'YOUR_AUTH_TOKEN'
response = everysk.Workspace.remove('sandbox')
print(json.dumps(response, indent=2))
Returns:
Warning: Deleting a workspace does not delete its objects.