A Python package that allows you to view fuel prices in Turkey based on cities.
490
A Python package that provides both CLI and API interfaces to fetch current fuel prices from Opet's website.
# Get fuel prices for Istanbul (34)
docker run sinanerdinc/opet cli --il 34
# Run API server on default port (8000)
docker run -p 8000:8000 sinanerdinc/opet api
# Or map to a different port
docker run -p 5050:8000 sinanerdinc/opet api
from opet.api import OpetApiClient
# Initialize client
client = OpetApiClient()
# Get list of provinces
provinces = client.get_provinces()
# Get fuel prices for a specific province
prices = client.get_price("34") # Istanbul
The API server provides the following endpoints:
GET /provinces - List all available provincesGET /prices/{province_id} - Get fuel prices for a specific provinceGET /lastupdate - Get the last update time-p flag-p 5050:8000 maps container's port 8000 to host's port 5050# Clone the repository
git clone https://github.com/sinanerdinc/opet.git
# Build Docker image
docker build -t opet .
# Run tests using pytest
pytest
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Content type
Image
Digest
sha256:ea0da1dbd…
Size
70.4 MB
Last updated
over 1 year ago
docker pull sinanerdinc/opet