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.1.tar.gz (16.3 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.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sipametrics-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for sipametrics-0.1.1.tar.gz
Algorithm Hash digest
SHA256 60669115335278f04fb6c6b72f4b78ba6412787f2dd35d709ed11263bba6ae2a
MD5 8afaba5928995392ddf0b0b1c1da6ae1
BLAKE2b-256 d2d199e2d131dfdb19db3c0f38a18911c2309f7dd7fc9b4e6092f6cf94f4ce47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sipametrics-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for sipametrics-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 544468db820674e34d1f47765f47a8fafdfe213e833846bf08b9b5e1c2d8e87b
MD5 8baf061721ea1994ecb06892d6b750b9
BLAKE2b-256 6ec58dd432866f36907efd4f02f1cfb75a81f755a9c87b9548b4364805ca8859

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