Skip to main content

API Client for the Serviceportal of Salzburg Netz GmbH

Project description

py-salzburgnetz

License: MIT Python Version

An asynchronous Python API client for the Salzburg Netz GmbH Serviceportal. This library allows you to access smart meter data, including consumption profiles, equipment information, and contract details.

Important Links

Features

  • Asynchronous: Built on aiohttp for efficient non-blocking I/O.
  • Type-safe: Uses Pydantic models for data validation and IDE autocompletion.
  • Comprehensive: Supports various endpoints:
    • Load profiles (standard and energy communities)
    • Installation (Anlagen) information
    • Equipment and meter details
    • Partner and outage information
    • Meter readings
    • Contract accounts (Vertragskonto)
  • Flexible Formats: Supports JSON (default), CSV, and XML response formats.

Installation

pip install salzburgnetz

Note: Replace with actual installation command if hosted on PyPI or use pip install git+https://github.com/DavidProdinger/py-salzburgnetz.git for GitHub.

Usage

You need a Token and your Customer ID from the Salzburg Netz Serviceportal to use this API.

Basic Example

import asyncio
from salzburgnetz.api import SalzburgNetzApi

async def main():
    # Authentication details from Salzburg Netz Serviceportal
    TOKEN = "your_api_token"
    CUSTOMER_ID = 12345678

    async with SalzburgNetzApi(token=TOKEN, customer=CUSTOMER_ID) as api:
        # Get all installations
        anlagen = await api.anlage()
        for anlage in anlagen:
            print(f"Anlage: {anlage.Anlage}, Zählpunkt: {anlage.Zählpunkt}")
            
            # Fetch consumption profile for a specific Zählpunkt
            profile = await api.profile(zaehlpunkt=anlage.Zählpunkt)
            for entry in profile:
                print(f"Time: {entry.timestamp}, Value: {entry.Wert} {entry.Einheit}")

if __name__ == "__main__":
    asyncio.run(main())

Advanced Usage

Fetching specific formats

You can request data in JSON (parsed to models), CSV, or XML (as strings).

from salzburgnetz.const import ApiFormat

# Returns a string in CSV format
csv_data = await api.profile(zaehlpunkt="...", response_format=ApiFormat.CSV)

# Returns a string in XML format
xml_data = await api.profile(zaehlpunkt="...", response_format=ApiFormat.XML)

Energy Communities (Energiegemeinschaft)

profile_eg = await api.profile_eg(zaehlpunkt="...")

Data Models

The library maps API responses to Pydantic models:

  • Anlage: Installation details.
  • Equipment: Meter and device information.
  • Profile: Consumption data points with helper properties like timestamp.
  • Partner: Customer profile and outage notifications.
  • Reading: Historical meter readings.

Requirements

  • Python 3.9+
  • aiohttp
  • pydantic

Development

Running Tests

Tests require environment variables for authentication:

export SALZBURGNETZ_TOKEN="your_token"
export SALZBURGNETZ_CUSTOMER="your_customer_id"
export SALZBURGNETZ_ZP1="your_test_zaehlpunkt"
pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This project is not affiliated with, maintained by, or endorsed by Salzburg Netz GmbH. It is an independent community project.

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

salzburgnetz-0.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

salzburgnetz-0.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file salzburgnetz-0.0.1.tar.gz.

File metadata

  • Download URL: salzburgnetz-0.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for salzburgnetz-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a944ca100c7ad81e206f27c5bb858bc4e2b06eff4dab23709291d083a6a45c31
MD5 a54d3926ddb5fda6354d1843586f82ee
BLAKE2b-256 a5844d01326298b5a4ee8739c972cd95712a1fbb465d45654bb54bfc097186c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for salzburgnetz-0.0.1.tar.gz:

Publisher: python-publish.yml on DavidProdinger/py-salzburgnetz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file salzburgnetz-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: salzburgnetz-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for salzburgnetz-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f189e0dd26492762ba7cd99339052add2a3075757eb1d657a73b479c83b4e43
MD5 2834a6bf9bb3820ecfbf63aa68e62ed0
BLAKE2b-256 241a9cde2a0f27593f249df0852a670aadf53f81bb9eb77c1986288a50ca1aa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for salzburgnetz-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on DavidProdinger/py-salzburgnetz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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