API Client for the Serviceportal of Salzburg Netz GmbH
Project description
py-salzburgnetz
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
- Service Portal
- Serviceportal FAQ
- Programmierschnittstelle (API) zum automatisierten Abruf von Daten
- API Documentation (offline PDF)
Features
- Asynchronous: Built on
aiohttpfor efficient non-blocking I/O. - Type-safe: Uses
Pydanticmodels 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 liketimestamp.Partner: Customer profile and outage notifications.Reading: Historical meter readings.
Requirements
- Python 3.9+
aiohttppydantic
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a944ca100c7ad81e206f27c5bb858bc4e2b06eff4dab23709291d083a6a45c31
|
|
| MD5 |
a54d3926ddb5fda6354d1843586f82ee
|
|
| BLAKE2b-256 |
a5844d01326298b5a4ee8739c972cd95712a1fbb465d45654bb54bfc097186c1
|
Provenance
The following attestation bundles were made for salzburgnetz-0.0.1.tar.gz:
Publisher:
python-publish.yml on DavidProdinger/py-salzburgnetz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
salzburgnetz-0.0.1.tar.gz -
Subject digest:
a944ca100c7ad81e206f27c5bb858bc4e2b06eff4dab23709291d083a6a45c31 - Sigstore transparency entry: 1340762217
- Sigstore integration time:
-
Permalink:
DavidProdinger/py-salzburgnetz@1b63ebb807ef6594d1a6fc36e16a34747c26b266 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/DavidProdinger
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1b63ebb807ef6594d1a6fc36e16a34747c26b266 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f189e0dd26492762ba7cd99339052add2a3075757eb1d657a73b479c83b4e43
|
|
| MD5 |
2834a6bf9bb3820ecfbf63aa68e62ed0
|
|
| BLAKE2b-256 |
241a9cde2a0f27593f249df0852a670aadf53f81bb9eb77c1986288a50ca1aa9
|
Provenance
The following attestation bundles were made for salzburgnetz-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on DavidProdinger/py-salzburgnetz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
salzburgnetz-0.0.1-py3-none-any.whl -
Subject digest:
6f189e0dd26492762ba7cd99339052add2a3075757eb1d657a73b479c83b4e43 - Sigstore transparency entry: 1340762219
- Sigstore integration time:
-
Permalink:
DavidProdinger/py-salzburgnetz@1b63ebb807ef6594d1a6fc36e16a34747c26b266 -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/DavidProdinger
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1b63ebb807ef6594d1a6fc36e16a34747c26b266 -
Trigger Event:
release
-
Statement type: