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
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 tankerkoenig-0.0.4.tar.gz.
File metadata
- Download URL: tankerkoenig-0.0.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a69538552814f9862b6e06ddcd0286396e3763abd3f24a7edfd0abe712232618
|
|
| MD5 |
38bf211eb4d17942bc5b037eb505e7f1
|
|
| BLAKE2b-256 |
e81af39ed42da0078dc5cc38cdbf7f5c9965e001e8650ad7ad1ce531860c6bf3
|
File details
Details for the file tankerkoenig-0.0.4-py3-none-any.whl.
File metadata
- Download URL: tankerkoenig-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f25e3ab734f63df79bccf05126513fb92883a57724be718e8fb56113d9f45c48
|
|
| MD5 |
b71ab11b18d072effbd7ce9ba293e4ec
|
|
| BLAKE2b-256 |
82568ff01f648cf8d54ba6db9159e17ace7e501c58328b38076b68e386773d1f
|