ukfuelfinder 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. ukfuelfinder-1.0.0/.env.example +6 -0
  2. ukfuelfinder-1.0.0/.flake8 +14 -0
  3. ukfuelfinder-1.0.0/.github/workflows/publish.yml +32 -0
  4. ukfuelfinder-1.0.0/.github/workflows/tests.yml +37 -0
  5. ukfuelfinder-1.0.0/.gitignore +84 -0
  6. ukfuelfinder-1.0.0/.kiro/specs/fuel-finder-api/design.md +1880 -0
  7. ukfuelfinder-1.0.0/.kiro/specs/fuel-finder-api/openapi.yaml +465 -0
  8. ukfuelfinder-1.0.0/.kiro/specs/fuel-finder-api/requirements.md +199 -0
  9. ukfuelfinder-1.0.0/.kiro/specs/fuel-finder-api/tasks.md +310 -0
  10. ukfuelfinder-1.0.0/CHANGELOG.md +38 -0
  11. ukfuelfinder-1.0.0/CONTRIBUTING.md +59 -0
  12. ukfuelfinder-1.0.0/IMPLEMENTATION_SUMMARY.md +196 -0
  13. ukfuelfinder-1.0.0/LICENSE +21 -0
  14. ukfuelfinder-1.0.0/PKG-INFO +233 -0
  15. ukfuelfinder-1.0.0/README.md +193 -0
  16. ukfuelfinder-1.0.0/SECURITY_AUDIT.md +53 -0
  17. ukfuelfinder-1.0.0/examples/basic_usage.py +38 -0
  18. ukfuelfinder-1.0.0/examples/error_handling.py +47 -0
  19. ukfuelfinder-1.0.0/examples/fetch_all_sites.py +80 -0
  20. ukfuelfinder-1.0.0/examples/fetch_fuel_prices.py +74 -0
  21. ukfuelfinder-1.0.0/examples/location_search.py +40 -0
  22. ukfuelfinder-1.0.0/pyproject.toml +75 -0
  23. ukfuelfinder-1.0.0/pytest.ini +15 -0
  24. ukfuelfinder-1.0.0/requirements-dev.txt +10 -0
  25. ukfuelfinder-1.0.0/requirements.txt +2 -0
  26. ukfuelfinder-1.0.0/setup.cfg +4 -0
  27. ukfuelfinder-1.0.0/setup.py +46 -0
  28. ukfuelfinder-1.0.0/test_fetch_stations.py +45 -0
  29. ukfuelfinder-1.0.0/tests/__init__.py +0 -0
  30. ukfuelfinder-1.0.0/tests/conftest.py +44 -0
  31. ukfuelfinder-1.0.0/tests/fixtures/__init__.py +0 -0
  32. ukfuelfinder-1.0.0/tests/fixtures/responses.py +68 -0
  33. ukfuelfinder-1.0.0/tests/integration/__init__.py +0 -0
  34. ukfuelfinder-1.0.0/tests/integration/test_real_api.py +78 -0
  35. ukfuelfinder-1.0.0/tests/unit/__init__.py +0 -0
  36. ukfuelfinder-1.0.0/tests/unit/test_auth.py +114 -0
  37. ukfuelfinder-1.0.0/tests/unit/test_cache.py +76 -0
  38. ukfuelfinder-1.0.0/tests/unit/test_location_search.py +133 -0
  39. ukfuelfinder-1.0.0/tests/unit/test_models.py +80 -0
  40. ukfuelfinder-1.0.0/tests/unit/test_rate_limiter.py +45 -0
  41. ukfuelfinder-1.0.0/ukfuelfinder/__init__.py +47 -0
  42. ukfuelfinder-1.0.0/ukfuelfinder/auth.py +111 -0
  43. ukfuelfinder-1.0.0/ukfuelfinder/cache.py +70 -0
  44. ukfuelfinder-1.0.0/ukfuelfinder/client.py +257 -0
  45. ukfuelfinder-1.0.0/ukfuelfinder/config.py +62 -0
  46. ukfuelfinder-1.0.0/ukfuelfinder/exceptions.py +83 -0
  47. ukfuelfinder-1.0.0/ukfuelfinder/http_client.py +116 -0
  48. ukfuelfinder-1.0.0/ukfuelfinder/models.py +154 -0
  49. ukfuelfinder-1.0.0/ukfuelfinder/rate_limiter.py +72 -0
  50. ukfuelfinder-1.0.0/ukfuelfinder/services/__init__.py +1 -0
  51. ukfuelfinder-1.0.0/ukfuelfinder/services/forecourt_service.py +108 -0
  52. ukfuelfinder-1.0.0/ukfuelfinder/services/price_service.py +72 -0
  53. ukfuelfinder-1.0.0/ukfuelfinder.egg-info/PKG-INFO +233 -0
  54. ukfuelfinder-1.0.0/ukfuelfinder.egg-info/SOURCES.txt +55 -0
  55. ukfuelfinder-1.0.0/ukfuelfinder.egg-info/dependency_links.txt +1 -0
  56. ukfuelfinder-1.0.0/ukfuelfinder.egg-info/requires.txt +11 -0
  57. ukfuelfinder-1.0.0/ukfuelfinder.egg-info/top_level.txt +1 -0
@@ -0,0 +1,6 @@
1
+ # UK Fuel Finder API Credentials
2
+ # Copy this file to .env and fill in your actual credentials
3
+
4
+ FUEL_FINDER_CLIENT_ID=your_client_id_here
5
+ FUEL_FINDER_CLIENT_SECRET=your_client_secret_here
6
+ FUEL_FINDER_ENVIRONMENT=production
@@ -0,0 +1,14 @@
1
+ [flake8]
2
+ max-line-length = 120
3
+ extend-ignore = E203, W503
4
+ exclude =
5
+ .git,
6
+ __pycache__,
7
+ build,
8
+ dist,
9
+ .eggs,
10
+ *.egg-info,
11
+ .venv,
12
+ venv,
13
+ .pytest_cache,
14
+ htmlcov
@@ -0,0 +1,32 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+ contents: read
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.11'
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install build
27
+
28
+ - name: Build package
29
+ run: python -m build
30
+
31
+ - name: Publish to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,37 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install pytest pytest-cov black flake8 python-dotenv responses
28
+ pip install -e .
29
+
30
+ - name: Run tests
31
+ run: |
32
+ pytest tests/unit/ -v --cov=ukfuelfinder --cov-report=term-missing
33
+
34
+ - name: Check code quality
35
+ run: |
36
+ black --check ukfuelfinder tests
37
+ flake8 ukfuelfinder
@@ -0,0 +1,84 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Unit test / coverage reports
35
+ htmlcov/
36
+ .tox/
37
+ .nox/
38
+ .coverage
39
+ .coverage.*
40
+ .cache
41
+ nosetests.xml
42
+ coverage.xml
43
+ *.cover
44
+ *.py,cover
45
+ .hypothesis/
46
+ .pytest_cache/
47
+
48
+ # Environments
49
+ .env
50
+ .venv
51
+ env/
52
+ venv/
53
+ ENV/
54
+ env.bak/
55
+ venv.bak/
56
+
57
+ # IDEs
58
+ .vscode/
59
+ .idea/
60
+ *.swp
61
+ *.swo
62
+ *~
63
+ .DS_Store
64
+
65
+ # Secrets
66
+ *.secret
67
+ *.key
68
+ config.yaml
69
+ fuel_finder_config.yaml
70
+
71
+ # mypy
72
+ .mypy_cache/
73
+ .dmypy.json
74
+ dmypy.json
75
+
76
+ # Pyre type checker
77
+ .pyre/
78
+
79
+ # VCR cassettes
80
+ tests/cassettes/
81
+
82
+ # Generated data files
83
+ fuel_prices_*.json
84
+ forecourt_sites_*.json