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 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 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.5.tar.gz (14.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.5-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sipametrics-0.1.5.tar.gz
  • Upload date:
  • Size: 14.3 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.5.tar.gz
Algorithm Hash digest
SHA256 2362199507cbc3c74bbb21c8eb226dc4b5a0d454415bb94de907f4ea6bb43810
MD5 c8b3fdc1d55707aaf6b23796ee1f9f02
BLAKE2b-256 f4d7c50319af0a2f19818311a726b08adb546d519b255544f9baf4e6f81ffc10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sipametrics-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7442693d4ab09ec9b400613ffbc6bbd597b6ba17b0f7c9b9540217e4aeb287
MD5 5c3c30713ff3d2e87784b21e67915831
BLAKE2b-256 bfc8994d3f360924392a47b270c2facc7bec5a0c40ca771c5b056bd42900f4f2

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