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.
Metadata
Release files for fuelfinder 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fuelfinder-0.1.3.tar.gz | 31.7 kB | Without provenance | Details for fuelfinder-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fuelfinder-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for fuelfinder-0.1.3-py3-none-any.whl |
Total release size: 36.5 kB
Release files / fuelfinder-0.1.3.tar.gz
| Download URL | fuelfinder-0.1.3.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb6d103b1b549c0733160fe1a5f3603b9211da5549646990aaa423174d0fd4cc
|
|
BLAKE2b-256 checksum How to use checksums |
d061434ca17f343b47bbad59ae70e6c64f1ff7e0a1431a8f6e599f4b5152135a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.30
|
Release files / fuelfinder-0.1.3-py3-none-any.whl
| Download URL | fuelfinder-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fecfd0cca62d6d7fbfee091d66058b2ba9016faef7c856c3e16abaf82cb5472
|
|
BLAKE2b-256 checksum How to use checksums |
262303d38f936124f4e85d4fb26f6ed347a2b0e0e974e00ed2ff4df7ff52dd8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.30
|
Security for fuelfinder 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.