Python library for accessing Mimit Fuel Prices API
Project description
mimitFuelPy
A Python library for accessing the Mimit Fuel Prices API. This library provides a clean, object-oriented interface for searching fuel stations and retrieving fuel pricing data in Italy.
๐ Table of Contents
- Installation
- Quick Start
- Features
- API Coverage
- Documentation
- Examples
- Development
- Contributing
- License
Installation
Install mimitfuelpy using pip:
pip install mimitfuelpy
Quick Start
from mimitfuelpy import Client
from mimitfuelpy.models import FuelType, ServiceType, SearchByBrandCriteria
# Initialize the client
client = Client()
# Search for fuel stations
criteria = SearchByBrandCriteria(
province="MI", # Milan
priceOrder="asc",
fuelType=FuelType.PETROL.value,
serviceType=ServiceType.SELF.value
)
results = client.search.byBrand(criteria)
for station in results.results:
print(f"{station.name}: {station.address}")
Features
- ๐ Station Search: Find fuel stations by location, brand, highway, or zone
- ๐ฐ Price Data: Get current fuel prices with filtering options
- ๐บ๏ธ Geographic Data: Access regions, provinces, towns, and highways
- ๐ Flexible Filtering: Filter by fuel type and service type
- ๐ข Service Areas: Detailed service area information with facilities
- ๐ Easy Integration: Simple, intuitive API design
API Coverage
Registry Operations
- Get all brands and their logos
- Get highways information
- Get regions, provinces, and towns hierarchy
- Get detailed service area information with services and hours
Search Operations
- Search by geographic zone
- Search by administrative area (province)
- Search by highway
- Search by brand with comprehensive filtering criteria
Documentation
๐ Complete documentation is available at: https://fpetranzan.github.io/mimitFuelPy/
The documentation includes:
- Installation Guide - Detailed installation instructions
- Quick Start Guide - Get up and running quickly
- API Reference - Complete API documentation
- Examples - Code examples and use cases
- Guides - In-depth guides and best practices
Documentation Development
The documentation is built using Jekyll with the "just-the-docs" theme and is automatically deployed to GitHub Pages.
Local Documentation Development
# Install Ruby dependencies
bundle install
# Serve documentation locally
bundle exec jekyll serve
# View at http://localhost:4000
Documentation Structure
docs/
โโโ index.md # Homepage
โโโ installation.md # Installation guide
โโโ quick-start.md # Quick start guide
โโโ api/ # API Reference
โ โโโ index.md
โ โโโ client.md
โ โโโ registry.md
โ โโโ models.md
โโโ examples/ # Code examples
โ โโโ index.md
โ โโโ basic-usage.md
โโโ guides/ # In-depth guides
โโโ index.md
โโโ getting-started.md
Examples
Basic Usage
from mimitfuelpy import Client
client = Client()
# Get all brands
brands = client.registry.brands()
print(f"Found {len(brands)} fuel brands")
# Get regions
regions = client.registry.regions()
print(f"Italy has {len(regions)} regions")
Advanced Search
from mimitfuelpy.models import SearchByBrandCriteria, FuelType
# Find cheapest diesel stations in Rome
criteria = SearchByBrandCriteria(
province="RM", # Rome
fuelType=FuelType.DIESEL.value,
priceOrder="asc" # Cheapest first
)
results = client.search.byBrand(criteria)
if results.success:
print(f"Found {len(results.results)} diesel stations")
for station in results.results[:5]:
print(f"- {station.name}: {station.address}")
See the examples/ directory and online documentation for more detailed usage examples.
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/fpetranzan/mimitFuelPy.git
cd mimitFuelPy
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Running Tests
# Run tests
python -m pytest tests/
# Run with coverage
python -m pytest tests/ --cov=src/mimitfuelpy --cov-report=html
Code Quality
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/
Project Structure
mimitFuelPy/
โโโ src/mimitfuelpy/ # Main package
โ โโโ api/ # API modules
โ โโโ models/ # Data models
โ โโโ utils/ # Utilities
โ โโโ client.py # Main client
โโโ tests/ # Test suite
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
โโโ .github/workflows/ # CI/CD workflows
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run the test suite:
pytest tests/ - Format your code:
black src/ tests/ - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Guidelines
- Write tests for new features
- Follow PEP 8 style guidelines
- Update documentation for API changes
- Ensure all tests pass before submitting
Reporting Issues
Please use the GitHub Issues page to report bugs or request features.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links:
- ๐ฆ PyPI Package
- ๐ Documentation
- ๐ Issue Tracker
Project details
Release history Release notifications | RSS feed
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 mimitfuelpy-0.2.1.tar.gz.
File metadata
- Download URL: mimitfuelpy-0.2.1.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf4e4ff806424cf87e2eef6f8ce145ca72c20dedc611a5a545feb2de86f0a958
|
|
| MD5 |
8918bcc080b46db05d676b0bca181802
|
|
| BLAKE2b-256 |
8897f090fd36f55c3ed920f46e3a97b2ebbcbb898286ca40d1a152104b54e4af
|
File details
Details for the file mimitfuelpy-0.2.1-py3-none-any.whl.
File metadata
- Download URL: mimitfuelpy-0.2.1-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364cc03f5fdce1e41ea9c867312fb301a070e898e48542c0d6d8d35ea79a4e19
|
|
| MD5 |
18df8aa45f373bb581d0283de506d913
|
|
| BLAKE2b-256 |
6a0e9ff9005624fa1f8e6d71af78b175e24bad0e2ef788fbac4b70d4e744589a
|