Skip to main content

Scientific Infra & Private Assets

Project description

SIPA Metrics Service

A Python package for interacting with the SIPA Metrics API to fetch metrics and other relevant data. This package simplifies integration by providing an easy-to-use interface for developers.

Installation

Install the package via pip:

pip install sipametrics

Usage

Here’s how you can use the sipametrics package in your Python projects.

Example 1: Simple Usage

This example demonstrates a basic way to initialize the service and fetch metrics using an async function.

import asyncio from sipametrics.services import SipaMetricsService

async def main():

service = SipaMetricsService(api_key=’your_api_key’, api_secret=’your_api_secret’) response = await service.metrics(entity_id=”INFRBGWX”, metric_id=”T01414”) print(response) await service.close()

if __name__ == “__main__”:

asyncio.run(main())

Example 2: Using Context Manager

This example uses a context manager (async with) for better resource management.

import aiohttp import asyncio from sipametrics.services import SipaMetricsService

async def main():
async with SipaMetricsService(api_key=’your_api_key’, api_secret=’your_api_secret’) as session:

response = await session.metrics(entity_id=”INFRBGWX”, metric_id=”T01414”) print(response)

asyncio.run(main())

API Reference

Service Initialization

  • SipaMetricsService(api_key: str, api_secret: str): Initializes the service with your API credentials.

Methods

  • metrics(entity_id: str, metric_id: str): Fetches metrics for a given entity and metric ID.

License

This package is licensed under the MIT License. See the LICENSE file for details.

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

sipametrics-0.1.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

sipametrics-0.1.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file sipametrics-0.1.2.tar.gz.

File metadata

  • Download URL: sipametrics-0.1.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/5.15.0-1075-aws

File hashes

Hashes for sipametrics-0.1.2.tar.gz
Algorithm Hash digest
SHA256 549cd1d0e593d75cf663efa872ccdc87be5849a0c81784102ce5ecaa78eaaba2
MD5 7a13b932c25f3d79d0ba40337350eb63
BLAKE2b-256 f9a0e1cb86ed621cda2933a050b0639697740ad9547badf4e337e164d2818147

See more details on using hashes here.

File details

Details for the file sipametrics-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sipametrics-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/5.15.0-1075-aws

File hashes

Hashes for sipametrics-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e324499826dfa650ef9b75d999cc7c233c0cf49d1e19bd3f6b542b6b271bf2eb
MD5 47006d2c684acc4d46516b348037d0e1
BLAKE2b-256 5ae71721e623911b8758acd580e330bb951778aff9da19aa1ccff68266f521f1

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