2.3 Python
This is a Python package that interacts with the SIPAMetrics REST API to fetch metrics and other relevant data, with the goal to simplify integration by providing an easy-to-use interface for developers.
This quick start guide will help you set up the API key, install the Python package, and explore the available API functions.
API Key
Please refer to this page for API key creation.
Python Package
This is a lightweight Python library that works as a wrapper to SIPAMetrics REST APIs.
pip install sipametrics
Or get the latest tarball from PyPI
Package Dependency
The sipametrics package requires the following packages:
aiohttp
python-dateutil
pydantic
pandas (optional) - only required for sipametrics.loaders helper module
API Library
Classes
SipaMetricsService
Constants
Full list of constants made available in the package can be located from the sipametrics.constants module.
Functions
2.3.5 private_equity_comparable
2.3.6 private_equity_comparable_boundaries
2.3.10 private_equity_region_tree
Sample Usage
With Context Manager (Recommended)
from sipametrics import SipaMetricsService
import sipametrics.constants as CONSTANTS
async with SipaMetricsService(api_key='your_api_key', api_secret='your_api_secret') as service:
response = await service.indices_catalogue(product=CONSTANTS.Product.PRIVATE_INFRA, app=CONSTANTS.App.MARKET_INDICES)
Without Context Manager
from sipametrics import SipaMetricsService
import sipametrics.constants as CONSTANTS
service = SipaMetricsService(api_key='your_api_key', api_secret='your_api_secret')
response = await service.indices_catalogue(product=CONSTANTS.Product.PRIVATE_INFRA, app=CONSTANTS.App.MARKET_INDICES)
await service.close()