Get started¶
The Everysk SDK is a Python library, distributed as the everysk-lib pip package. It gives you classes for the platform's entities (portfolios, datastores, reports, files…), engines for expressions, compliance and market data, and the utilities Everysk uses in its own projects.
Installation¶
To install the Everysk library, you will need to use pip's install command:
The package is on PyPI. It requires Python 3.11 or later.
Open a python terminal and run the following import:
If the library has been installed correctly, this command should complete without any errors. If the library is not installed or there's a problem with the installation, Python will raise a ModuleNotFoundError
Authentication¶
The SDK sends your API credentials with each request to the Everysk platform. Set two values before you call an entity or an engine:
| Setting | Value |
|---|---|
EVERYSK_API_SID |
Your Account SID |
EVERYSK_API_TOKEN |
Your Auth Token |
Create and manage your credentials in the API Keys tab of the API Manager. Keep your Account SID and Auth Token secret. Do not commit them to a repository.
The SDK reads both values from the settings object of the Config module. Set them in the environment or in the code. You do not need both.
Export the two variables in the shell that runs your code:
If you set a value in both places, the value in the code has priority.
Quickstart¶
With the credentials set, retrieve a portfolio by its ID:
from everysk.sdk.entities import Portfolio
portfolio = Portfolio.retrieve('port_V7xU8dwCMnJIuyUPHJPx2ynuz')
portfolio.name
# 'My Portfolio'
Every entity has the same create(), retrieve(), modify() and delete() methods. See Base Entity.
What's in the library¶
| Section | What it covers |
|---|---|
| Entities | Classes for the platform's objects, like Portfolio, Datastore and Report, and how to query them. |
| Engines | Expression, compliance, market data, cache and lock. |
| Worker Base | The base class for writing your own workers. |
| Server | A web server for HTML pages and REST endpoints. |
| Core utilities | Dates, numbers, strings, logs, HTTP, exceptions and other helpers used across the library. Start with Config. |
| Legacy API wrapper | A Python wrapper around the REST API. Deprecated: use the entities instead. |