Skip to main content

Python library for Osservaprezzi Carburanti

Project description

Client Library for Osservaprezzi

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.4.tar.gz (31.8 kB view hashes)

Uploaded Source

Built Distribution

osservaprezzi-0.1.4-py3-none-any.whl (18.7 kB view hashes)

Uploaded Python 3

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