Wrapper for creativecommons.tankerkoenig.de API
Project description
Tankerkoenig-Python
Python wrapper for the creativecommons.tankerkoenig.de API
Note: The API is under Creative Commons (CC BY 4.0) license. It is used by many clients so please restrict API calls to the minimum. Every request requires an API key that can be requested here
Examples
Finding petrol stations around a certain coordinate:
import tankerkoenig
client = tankerkoenig.Client(api_key="00000000-0000-0000-0000-000000000002")
petrol_stations = client.list(
lat=50.114634,
lng=8.687657,
rad=2,
petrol_type=tankerkoenig.Petrol.DIESEL,
sort=tankerkoenig.SortingMethod.DISTANCE,
)
print(petrol_stations)
Accessing details of a station by its ID:
import tankerkoenig
client = tankerkoenig.Client(api_key="00000000-0000-0000-0000-000000000002")
details = client.details(id="24a381e3-0d72-416d-bfd8-b2f65f6e5802")
print(details)
# Details_Model(
# ok=True,
# license='CC BY 4.0 - https://creativecommons.tankerkoenig.de',
# data='MTS-K',
# status='ok',
# station=Details_Station(
# id='24a381e3-0d72-416d-bfd8-b2f65f6e5802',
# name='Esso Tankstelle',
# brand='ESSO',
# street='HAUPTSTR. 7',
# houseNumber=' ',
# postCode=84152,
# place='MENGKOFEN',
# openingTimes=[
# Details_OpeningTime(
# text='Mo-Fr',
# start='05:00:00',
# end='22:30:00',
# ),
# Details_OpeningTime(
# text='Samstag',
# start='07:00:00',
# end='22:30:00',
# ),
# Details_OpeningTime(
# text='Sonntag, Feiertag',
# start='08:00:00',
# end='22:30:00',
# ),
# ],
# overrides=[],
# wholeDay=False,
# isOpen=True,
# e5=1.009,
# e10=1.009,
# diesel=1.009,
# lat=48.72210601,
# lng=12.44438439,
# state=None,
# ),
# )
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
tankerkoenig-0.0.2.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for tankerkoenig-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dabd955e2b3cc09eac46f66e6842e1cb80b7dbac3de3affe1b2f7df7b8458df7 |
|
MD5 | 6b129840e146263842d52c136a6bdf83 |
|
BLAKE2b-256 | 5b112879e93af81862d8ab0ee6a1e72932debf76a8f00bdfcbe6adaf28b5e6e2 |