Skip to main content

Python library for Osservaprezzi Carburanti

Project description

Client Library for Osservaprezzi

Reliability Rating Security Rating Maintainability Rating Lines of Code Coverage

Please report any issues and feel free to raise pull requests.

BuyMeCoffee

Installation

If you have a recent version of Python 3, you should be able to do pip install osservaprezzi to get the most recently released version of this.

Usage

You are welcome to try using this as a python library for other efforts. A simple usage might go something like this:

import aiohttp
import asyncio
import logging

from osservaprezzi.client import Osservaprezzi
from osservaprezzi.models import GPSCoordinates


async def main():
  async with aiohttp.ClientSession() as session:
    logging.basicConfig(level=logging.DEBUG)
    client = Osservaprezzi(session)

    # brands list
    brands = await client.get_brands()
    for brand in brands:
        print(brand.name)

    # fuels list
    fuels = await client.get_fuels()
    for fuel in fuels:
        print(fuel)

    # stations list 5 km near 45.541553,10.211802
    location = GPSCoordinates(latitude=45.541553, longitude=10.211802)
    stations = await client.get_stations(location, radius=5)
    for station in stations:
       print(station.name)

    # station details
    station = await client.get_station(47997)
    print(station.name)


if __name__ == '__main__':
    asyncio.run(main())

Thanks

My heartfelt thanks to:

  • All the users who have given useful feedback and contributed code!

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

osservaprezzi-0.1.5.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

osservaprezzi-0.1.5-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file osservaprezzi-0.1.5.tar.gz.

File metadata

  • Download URL: osservaprezzi-0.1.5.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for osservaprezzi-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a2cae33abcb3d6426326909d2b9cfb87a8cbc8a76c2e59304557af28781a5020
MD5 68e975ed359a9196b4438bcebff6037a
BLAKE2b-256 03b463a39ed471d7b4a16680370168266fc14e8c5e48401c71549a6d592d7e30

See more details on using hashes here.

File details

Details for the file osservaprezzi-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for osservaprezzi-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae935aeede78b091de2687b0eb4c48125dc49c7a14e782ffb22649217ccbb1c
MD5 dc0f0e2b6f776b1a4f4ca298ebfb95e2
BLAKE2b-256 00e03d9202e832bd581884abb652be5e1c03659cf9cc92c52811e10b8e7178c2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page