Skip to main content

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.dk website.
  • 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 ruff to 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 variable FUELLIST_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)

Source distribution for fuelfinder 0.1.3
File Size Uploaded
fuelfinder-0.1.3.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fuelfinder 0.1.3
File Interpreter ABI Platform
fuelfinder-0.1.3-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page