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:

.. code-block:: bash

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.

.. code-block:: python

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__":
    import asyncio
    asyncio.run(main())

Example 2: Using Context Manager

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

.. code-block:: python

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.0.tar.gz (16.4 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.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sipametrics-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 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.0.tar.gz
Algorithm Hash digest
SHA256 29d2f9ee0400d687dd4a3eae3071c58960927416b1f083e73ec2ad8b0794020d
MD5 1c0878a03802a90de5627b60026b8972
BLAKE2b-256 50113020148e8fc962e11194e0c01f73de10c6be7e6198f5af91b135e06ee5e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sipametrics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94dba5d5bc0ccc2e2383df47d714087eec7c6860c0cc24fcf165e94a9547e9d8
MD5 41fe15f4bb6736035a09036903a4483e
BLAKE2b-256 fc67083326795b1f4a2d61567d241fef6c083059763a5a841542513077abee2c

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