Skip to main content

A Python package for interacting with the balkongas API.

Project description

BalkonGas Python

A small library to interact with the BalkonGas API for a reactor. It allows you to get the latest values for a reactor.

📦 Installation

pip install balkongas

🚀 Quick start

In this example, we create a reactor based on the data from this URL https://api.balkongas.de/metrics/6f1d3382-6b95-4adc-9d6f-6785ae0456f3/json/latest/

from balkongas import Reactor
r = Reactor('6f1d3382-6b95-4adc-9d6f-6785ae0456f3')
r.refresh()
print(r.data["uptime_sec"])

🚀 Development

1️⃣ Setup a Local Development Environment

  1. Clone the repository
    git clone https://github.com/balkongas/BalkonGas-Python.git
    cd balkongas
    
  2. Create a virtual environment
    python -m venv .venv
    
  3. Activate the virtual environment
    • macOS/Linux:
      source .venv/bin/activate
      
    • Windows (CMD):
      .venv\Scripts\activate
      
    • Windows (PowerShell):
      .venv\Scripts\Activate.ps1
      
  4. Install dependencies
    pip install -e .[dev]
    

2️⃣ Running Tests

To run tests using pytest, use:

pytest

3️⃣ Building the Package

To build the package, run:

python -m build

This will generate a dist/ directory with .tar.gz and .whl files.

4️⃣ Uploading to PyPI

  1. Ensure you have Twine installed
    pip install twine
    
  2. Upload the package
    twine upload dist/*
    
  3. Verify installation from PyPI
    pip install balkongas
    

Now you're ready to develop, test, and distribute balkongas! 🚀

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

balkongas-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

balkongas-0.1.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: balkongas-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for balkongas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8e53aaf3a3911b7b593203f01babffdffa070039a34843c92099866acddbeec7
MD5 124f1426b6549ca4c94be7745ea30fd1
BLAKE2b-256 a0becfd734213fa2ce817db6bd3abf20ecc57e43de07a411cb0f3d2a104ce4f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: balkongas-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for balkongas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4f227f7325cd5a75a879d868b923a9017e185d4bccfa61b2943d9e2dc431c3e
MD5 e964db4f80b914bae24613c124d164a9
BLAKE2b-256 c1ac87ae521cc91b9272fe08bdb98ae4ebfcba1c216d50daa521e243b5885a90

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