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.3.tar.gz (14.2 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.3-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sipametrics-0.1.3.tar.gz
  • Upload date:
  • Size: 14.2 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.3.tar.gz
Algorithm Hash digest
SHA256 df08df77b380e3c45e37f909625fa999f0981e184715fdfec74aeb342b708bf2
MD5 4a91808b3f8b3d9e5794d59904d19ce0
BLAKE2b-256 c65009fdaa023a7dbbc6fd30563e99f6446cb1d606806d1d71635b6634eef29d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sipametrics-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 16a69457c3fefffdda3f0dca00bc2c182f527324fe768c10c6c2cd9d426d163e
MD5 63d18f104d6cc3111aabf90430cf1e5f
BLAKE2b-256 4c521d3b4319ec327d720a2cf89765dcf3a8bea7bbcd8b8fd9d1a8f2dc912e63

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