Add your description here
Project description
Fuelfinder
Fuelfinder is a Python tool to scrape fuel prices from fuelfinder.dk. It provides functionality to fetch current fuel prices while maintaining rate limiting and local caching, ensuring minimal requests to the server.
Features
- Scrape Fuel Prices: Get up-to-date fuel prices from the
fuelfinder.dkwebsite. - Rate Limiting: Ensures that requests to the server are made no more than once every 5 minutes using a persistent cache.
- Command-Line Interface (CLI): Built using Typer, allowing easy usage and configuration.
- Debug Logging: Optional debug logging using Python's built-in logging for better transparency and troubleshooting.
- Pre-commit Setup: Uses
ruffto ensure the code meets quality and consistency standards.
Installation
To install Fuelfinder, clone the repository and use uv to manage dependencies:
# Clone the repository
git clone https://github.com/yourusername/fuelfinder.git
cd fuelfinder
# Install dependencies using uv
uv sync
Usage
You can use the Fuelfinder CLI to fetch danish fuel prices directly from the command line:
# Run Fuelfinder
uvx run fuelfinder
Command-line Options
--url: The URL to fetch gas prices from (can also be set via the environment variableFUELLIST_URL).--debug: Enable debug logging for more detailed output.
For example:
uvx fuelfinder --debug
Pre-commit Hooks
This project uses pre-commit to ensure code quality. The hooks used include:
- Ruff: A fast Python linter and code formatter.
- Pre-commit Hooks: Various checks, including trailing whitespace and YAML/JSON validation.
To set up pre-commit hooks:
pre-commit install
To run the hooks manually on all files:
pre-commit run --all-files
Configuration
The caching for fuel prices is implemented using diskcache and is stored in ~/.cache/fuelfinder_cache to persist across invocations. The default caching duration is 5 minutes.
Development
If you want to contribute to Fuelfinder, feel free to submit a pull request. Please make sure your code adheres to the following guidelines:
- Ensure the code passes all pre-commit hooks.
- Write clear and concise documentation for any new functionality.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- fuelfinder.dk for providing the data source.
- The authors of
ruff,typer,diskcache, and other open-source projects used in this tool.
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 fuelfinder-0.1.3.tar.gz.
File metadata
- Download URL: fuelfinder-0.1.3.tar.gz
- Upload date:
- Size: 31.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb6d103b1b549c0733160fe1a5f3603b9211da5549646990aaa423174d0fd4cc
|
|
| MD5 |
98edf60477f111c4d5181284b7f2e7d4
|
|
| BLAKE2b-256 |
d061434ca17f343b47bbad59ae70e6c64f1ff7e0a1431a8f6e599f4b5152135a
|
File details
Details for the file fuelfinder-0.1.3-py3-none-any.whl.
File metadata
- Download URL: fuelfinder-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fecfd0cca62d6d7fbfee091d66058b2ba9016faef7c856c3e16abaf82cb5472
|
|
| MD5 |
d46741b2d0407075049357433562ff74
|
|
| BLAKE2b-256 |
262303d38f936124f4e85d4fb26f6ed347a2b0e0e974e00ed2ff4df7ff52dd8b
|