Skip to main content

pytankerkoenig

Python package for fuel data from tankerkoenig.de

Prerequisites

You need to request an API-Key here: https://creativecommons.tankerkoenig.de.

For station details, find the station id via this tool: https://creativecommons.tankerkoenig.de/TankstellenFinder/index.html

Installation

$ pip install pytankerkoenig

Use

getStationData(API_KEY, STATION_ID)

>>> import pytankerkoenig
>>> data = pytankerkoenig.getStationData('00000000-0000-0000-0000-000000000002','24a381e3-0d72-416d-bfd8-b2f65f6e5802')
>>> print(data)
{
    'ok': True,
    'license': 'CC BY 4.0 -  https://creativecommons.tankerkoenig.de',
    'data': 'MTS-K',
    'status': 'ok',
    'station': {
        'id': '24a381e3-0d72-416d-bfd8-b2f65f6e5802',
        'name': 'Esso Tankstelle',
        'brand': 'ESSO',
        'street': 'HAUPTSTR. 7',
        'houseNumber': ' ',
        'postCode': 84152,
        'place': 'MENGKOFEN',
        'openingTimes': [{'text': 'Mo-Fr', 'start': '06:00:00',
                         'end': '22:00:00'}, {'text': 'Samstag',
                         'start': '07:00:00', 'end': '22:00:00'},
                         {'text': 'Sonntag, Feiertag',
                         'start': '08:00:00', 'end': '22:00:00'}],
        'overrides': [],
        'wholeDay': False,
        'isOpen': True,
        'e5': 1.009,
        'e10': 1.009,
        'diesel': 1.009,
        'lat': 48.72210601,
        'lng': 12.44438439,
        'state': None,
        },
    }

getPriceList(API_KEY, STATION_IDS[])

>>> import pytankerkoenig
>>> data = pytankerkoenig.getStationData('00000000-0000-0000-0000-000000000002',['5bd71e9d-7001-4908-a29d-36c28d6eb615','005056ba-7cb6-1ed2-bceb-92a737c6ad35'])
>>> print(data)
{
    'ok': True,
    'license': 'CC BY 4.0 -  https://creativecommons.tankerkoenig.de',
    'data': 'MTS-K',
    'prices': {'005056ba-7cb6-1ed2-bceb-92a737c6ad35': {
        'status': 'open',
        'e5': 1.234,
        'e10': 1.234,
        'diesel': 1.234,
        }, '5bd71e9d-7001-4908-a29d-36c28d6eb615': {
        'status': 'open',
        'e5': 1.234,
        'e10': 1.234,
        'diesel': 1.234,
        }},
    }

getNearbyStations(API_KEY, LATITUDE, LONGITUDE, RADIUS, TYPE, SORT)

>>> import pytankerkoenig
>>> data = pytankerkoenig.getNearbyStations('00000000-0000-0000-0000-000000000002','50.75','7.25','3','all','dist')
>>> print(data)
{
  'ok': True,
  'license': 'CC BY 4.0 -  https://creativecommons.tankerkoenig.de',
  'data': 'MTS-K',
  'status': 'ok',
  'stations': [{
    'id': '1bb14157-1242-41fc-a74a-4f916dea4634',
    'name': 'Sankt Augustin Birlinghoven',
    'brand': 'Mundorf Tank',
    'street': 'Pleistalstraße',
    'place': 'Sankt Augustin-Birlinghoven',
    'lat': 50.748416,
    'lng': 7.225838,
    'dist': 1.7,
    'diesel': 1.009,
    'e5': 1.009,
    'e10': 1.009,
    'isOpen': False,
    'houseNumber': '231',
    'postCode': 53757
  }, {
    'id': 'd4a4644c-cd86-42a5-9cfa-ec6c58204312',
    'name': 'Hennef-Geistingen',
    'brand': 'Mundorf Tank',
    'street': 'Stoßdorfer Straße',
    'place': 'Hennef-Geistingen',
    'lat': 50.773616,
    'lng': 7.265088,
    'dist': 2.8,
    'diesel': 1.009,
    'e5': 1.009,
    'e10': 1.009,
    'isOpen': True,
    'houseNumber': '8a',
    'postCode': 53773
  }]
}

Metadata

Release files for pytankerkoenig 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytankerkoenig 0.0.7
File Size Uploaded Provenance Actions
pytankerkoenig-0.0.7.tar.gz 4.0 kB Without provenance Details for pytankerkoenig-0.0.7.tar.gz

Release files / pytankerkoenig-0.0.7.tar.gz

Download URL pytankerkoenig-0.0.7.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
201c9d2932ea17c8a1c122f910956d606609a25eae7f83be3ba20c4b54782e08
BLAKE2b-256 checksum
How to use checksums
5e39f3d6a47ed2506268cba339bbc9681a04156848bda3c6659de9bac42b4d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Security for pytankerkoenig 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page