Skip to main content

Skellefteå Kraft API package

Project description

Skellefteå Kraft API

This is a simple API for Skellefteå Kraft and requires username & password as a login method . If you do not have it you can go to mina sidor, https://minasidor.skekraft.se/login, login with bankid and create one by going to Mitt Konto and then Inloggning.

Examples

Simple example on how to login with username & password:

from external.skekraft.api import SkekraftAPI
import asyncio

base_url = "https://externalapi.skekraft.se/api/MySkekraft"
skekraft_api = SkekraftAPI(base_url)
login_response = await skekraft_api.login("username", "password")
if login_response is not None and int(login_response['ErrNumber']) == 1:
    print(f"Login successful. Token: {login_response['Dst']}")
else:
    print(f"Login Failed: {login_response['ErrDescription']}")
    await skekraft_api.logout()
    exit(-1)
        login_response = await skekraft_api.login("username", "password")

You can also use a token if you have one. Do remember to refresh it regurlary do not invalide it:

from external.skekraft.api import SkekraftAPI
import asyncio

base_url = "https://externalapi.skekraft.se/api/MySkekraft"
skekraft_api = SkekraftAPI(base_url)
token = "your-token-here"
token = await skekraft_api.refresh(token)
log(f"Response: {token}")

See example.py for more examples details on how it can be used

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

skekraft-0.0.1.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.

SkeKraft-0.0.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skekraft-0.0.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for skekraft-0.0.1.tar.gz
Algorithm Hash digest
SHA256 69b60e06933718ea5396877c125760df250c53377919607caae4a385c9eaa410
MD5 92692f0447fb681153656008fac8341c
BLAKE2b-256 fd0d01d1e61d7744b26430375155f78faefae6603330100f63a495a10f8ef75b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: SkeKraft-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for SkeKraft-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae2fad42339b1b47627ab9e37d4bd11090a0f50f127b034382ff439c313782a
MD5 08a8198502c5df306ad464da34277f33
BLAKE2b-256 21c971c4cdcce5e381a5b579a7713726e13cf6ca91646169bdf7c3b8b0b69737

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