kroger-api 0.2.0__tar.gz → 0.3.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.
- {kroger_api-0.2.0 → kroger_api-0.3.0}/MANIFEST.in +2 -2
- {kroger_api-0.2.0/kroger_api.egg-info → kroger_api-0.3.0}/PKG-INFO +10 -7
- {kroger_api-0.2.0 → kroger_api-0.3.0}/README.md +9 -1
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/__init__.py +2 -1
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/authorization.py +1 -1
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/client.py +3 -2
- kroger_api-0.3.0/kroger_api/tests/test_auth.py +0 -0
- kroger_api-0.3.0/kroger_api/tests/test_client.py +36 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/token_storage.py +41 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0/kroger_api.egg-info}/PKG-INFO +10 -7
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api.egg-info/SOURCES.txt +2 -5
- {kroger_api-0.2.0 → kroger_api-0.3.0}/pyproject.toml +2 -3
- kroger_api-0.2.0/CHANGELOG.md +0 -34
- kroger_api-0.2.0/assets/kroger-api-python-add-to-cart-demo.mp4 +0 -0
- kroger_api-0.2.0/assets/product_api_script.gif +0 -0
- kroger_api-0.2.0/kroger_api.egg-info/not-zip-safe +0 -1
- kroger_api-0.2.0/setup.py +0 -75
- {kroger_api-0.2.0 → kroger_api-0.3.0}/LICENSE +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/authorization_api_examples.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/cart_api_examples.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/clear_tokens.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/identity_api_examples.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/location_api_examples.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/oauth_flow.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/oauth_pkce_flow.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/product_api_examples.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/examples/token_refresh_example.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/__init__.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/cart.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/identity.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/location.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/api/product.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/auth/__init__.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/auth/interactive.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/kroger_api.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/utils/__init__.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/utils/env.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/utils/oauth.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api/utils/pkce.py +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api.egg-info/dependency_links.txt +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api.egg-info/requires.txt +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/kroger_api.egg-info/top_level.txt +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/requirements.txt +0 -0
- {kroger_api-0.2.0 → kroger_api-0.3.0}/setup.cfg +0 -0
|
@@ -7,8 +7,8 @@ include LICENSE
|
|
|
7
7
|
# Include requirements
|
|
8
8
|
include requirements.txt
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
recursive-
|
|
10
|
+
# Media assets stay on GitHub; don't ship them in the sdist
|
|
11
|
+
recursive-exclude assets *
|
|
12
12
|
|
|
13
13
|
# Include examples directory but don't package them in the main distribution
|
|
14
14
|
recursive-include examples *.py
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kroger-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A Python client library for the Kroger Public API
|
|
5
|
-
Home-page: https://github.com/CupOfOwls/kroger-api
|
|
6
|
-
Author: Stephen Thoemmes
|
|
7
5
|
Author-email: Stephen Thoemmes <thoemmes.stephen@gmail.com>
|
|
8
6
|
License: MIT License
|
|
9
7
|
|
|
@@ -61,10 +59,7 @@ Requires-Dist: flake8; extra == "dev"
|
|
|
61
59
|
Requires-Dist: mypy; extra == "dev"
|
|
62
60
|
Provides-Extra: examples
|
|
63
61
|
Requires-Dist: tabulate>=0.8.0; extra == "examples"
|
|
64
|
-
Dynamic: author
|
|
65
|
-
Dynamic: home-page
|
|
66
62
|
Dynamic: license-file
|
|
67
|
-
Dynamic: requires-python
|
|
68
63
|
|
|
69
64
|
# 🛒 Kroger Public API 🛍️ -- with Examples in Python 🐍
|
|
70
65
|
|
|
@@ -76,6 +71,8 @@ Adding an item to your cart via an interactive Python script, and checking that
|
|
|
76
71
|
|
|
77
72
|
https://github.com/user-attachments/assets/0079cbc7-5af0-473b-909a-d43508fe43d5
|
|
78
73
|
|
|
74
|
+
You can also check out [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp), which is an implementation of the Model Context Protocol leveraging this kroger-api package!
|
|
75
|
+
|
|
79
76
|
## 🚀 Quick Start
|
|
80
77
|
|
|
81
78
|
### Installation
|
|
@@ -175,9 +172,15 @@ This library implements robust, automatic token management:
|
|
|
175
172
|
2. On 401 Unauthorized errors, attempts token refresh
|
|
176
173
|
3. Retries original request with new token
|
|
177
174
|
|
|
178
|
-
Token files (automatically managed
|
|
175
|
+
Token files (automatically managed):
|
|
179
176
|
- `.kroger_token_client_product.compact.json` - Client credentials tokens
|
|
180
177
|
- `.kroger_token_user.json` - User authorization tokens
|
|
178
|
+
These tokens are stored in the first matching location:
|
|
179
|
+
1. `$KROGER_TOKEN_DIR` — set this environment variable to choose the directory yourself
|
|
180
|
+
2. `$XDG_DATA_HOME/kroger-mcp/` (defaults to `~/.local/share/kroger-mcp/`) on Unix-like machines (macOS, Linux)
|
|
181
|
+
3. `%APPDATA%\kroger-mcp\` on Windows
|
|
182
|
+
|
|
183
|
+
The directory is shared with the [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp) package so both reuse the same tokens, and it is always writable even when the process is launched with a read-only working directory (e.g. MCP servers under Claude Desktop on Windows).
|
|
181
184
|
|
|
182
185
|
### 🔒 Enhanced Security with PKCE
|
|
183
186
|
|
|
@@ -8,6 +8,8 @@ Adding an item to your cart via an interactive Python script, and checking that
|
|
|
8
8
|
|
|
9
9
|
https://github.com/user-attachments/assets/0079cbc7-5af0-473b-909a-d43508fe43d5
|
|
10
10
|
|
|
11
|
+
You can also check out [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp), which is an implementation of the Model Context Protocol leveraging this kroger-api package!
|
|
12
|
+
|
|
11
13
|
## 🚀 Quick Start
|
|
12
14
|
|
|
13
15
|
### Installation
|
|
@@ -107,9 +109,15 @@ This library implements robust, automatic token management:
|
|
|
107
109
|
2. On 401 Unauthorized errors, attempts token refresh
|
|
108
110
|
3. Retries original request with new token
|
|
109
111
|
|
|
110
|
-
Token files (automatically managed
|
|
112
|
+
Token files (automatically managed):
|
|
111
113
|
- `.kroger_token_client_product.compact.json` - Client credentials tokens
|
|
112
114
|
- `.kroger_token_user.json` - User authorization tokens
|
|
115
|
+
These tokens are stored in the first matching location:
|
|
116
|
+
1. `$KROGER_TOKEN_DIR` — set this environment variable to choose the directory yourself
|
|
117
|
+
2. `$XDG_DATA_HOME/kroger-mcp/` (defaults to `~/.local/share/kroger-mcp/`) on Unix-like machines (macOS, Linux)
|
|
118
|
+
3. `%APPDATA%\kroger-mcp\` on Windows
|
|
119
|
+
|
|
120
|
+
The directory is shared with the [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp) package so both reuse the same tokens, and it is always writable even when the process is launched with a read-only working directory (e.g. MCP servers under Claude Desktop on Windows).
|
|
113
121
|
|
|
114
122
|
### 🔒 Enhanced Security with PKCE
|
|
115
123
|
|
|
@@ -21,7 +21,7 @@ class KrogerClient:
|
|
|
21
21
|
Base client for interacting with the Kroger API
|
|
22
22
|
"""
|
|
23
23
|
BASE_URL = "https://api.kroger.com"
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
def __init__(self, client_id: str = None, client_secret: str = None, redirect_uri: str = None):
|
|
26
26
|
"""
|
|
27
27
|
Initialize the Kroger API client
|
|
@@ -91,7 +91,8 @@ class KrogerClient:
|
|
|
91
91
|
Returns:
|
|
92
92
|
The token information
|
|
93
93
|
"""
|
|
94
|
-
# Set the token file for this scope
|
|
94
|
+
# Set the token file for this scope (resolved to a writable
|
|
95
|
+
# directory by token_storage.get_token_file_path)
|
|
95
96
|
self.token_file = f".kroger_token_client_{scope.replace(':', '_')}.json"
|
|
96
97
|
|
|
97
98
|
# Try to load an existing token first
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from unittest.mock import patch, MagicMock
|
|
3
|
+
from kroger_api.client import KrogerClient
|
|
4
|
+
|
|
5
|
+
class TestKrogerClient(unittest.TestCase):
|
|
6
|
+
|
|
7
|
+
def setUp(self):
|
|
8
|
+
self.client = KrogerClient(client_id="fake_id", client_secret="fake_secret", redirect_uri="http://redirect.uri")
|
|
9
|
+
|
|
10
|
+
def test_get_authorization_url_basic(self):
|
|
11
|
+
url = self.client.get_authorization_url(scope="openid profile")
|
|
12
|
+
self.assertIn("scope=openid profile", url)
|
|
13
|
+
self.assertIn("client_id=fake_id", url)
|
|
14
|
+
self.assertIn("redirect_uri=http://redirect.uri", url)
|
|
15
|
+
|
|
16
|
+
@patch('kroger_api.client.load_token')
|
|
17
|
+
@patch('kroger_api.client.save_token')
|
|
18
|
+
@patch('kroger_api.client.requests.post')
|
|
19
|
+
|
|
20
|
+
def test_get_token_with_client_credentials(self, mock_post, mock_save_token, mock_load_token):
|
|
21
|
+
#mock load_token to return None
|
|
22
|
+
mock_load_token.return_value = None
|
|
23
|
+
|
|
24
|
+
#mock response from requests.post
|
|
25
|
+
mock_response = MagicMock()
|
|
26
|
+
mock_response.json.return_value = {"access_token": "abc123", "expires_in": 3600}
|
|
27
|
+
mock_response.raise_for_status = lambda: None
|
|
28
|
+
mock_post.return_value = mock_response
|
|
29
|
+
|
|
30
|
+
token_info = self.client.get_token_with_client_credentials("scope1")
|
|
31
|
+
|
|
32
|
+
self.assertEqual(token_info["access_token"], "abc123")
|
|
33
|
+
mock_save_token.assert_called_once()
|
|
34
|
+
|
|
35
|
+
if __name__ == '__main__':
|
|
36
|
+
unittest.main()
|
|
@@ -5,11 +5,38 @@ This module provides functions to save and load OAuth tokens to avoid repeated l
|
|
|
5
5
|
|
|
6
6
|
import os
|
|
7
7
|
import json
|
|
8
|
+
from pathlib import Path
|
|
8
9
|
from typing import Dict, Any, Optional
|
|
9
10
|
|
|
10
11
|
# Default token file location
|
|
11
12
|
TOKEN_FILE = ".kroger_tokens.json"
|
|
12
13
|
|
|
14
|
+
def get_token_file_path(token_name) -> str:
|
|
15
|
+
"""Get the appropriate path for storing the token file.
|
|
16
|
+
|
|
17
|
+
Resolution order:
|
|
18
|
+
1. If token_name is already an absolute path, use it as-is.
|
|
19
|
+
2. If KROGER_TOKEN_DIR is set, store the file there.
|
|
20
|
+
3. Otherwise use the platform data directory (XDG spec on Unix,
|
|
21
|
+
APPDATA on Windows) under a 'kroger-mcp' subdirectory, which is
|
|
22
|
+
shared with the kroger-mcp package so both reuse the same tokens.
|
|
23
|
+
"""
|
|
24
|
+
if os.path.isabs(token_name):
|
|
25
|
+
return token_name
|
|
26
|
+
|
|
27
|
+
env_dir = os.environ.get('KROGER_TOKEN_DIR')
|
|
28
|
+
if env_dir:
|
|
29
|
+
token_dir = Path(env_dir).expanduser()
|
|
30
|
+
elif os.name == 'nt': # Windows
|
|
31
|
+
token_dir = Path(os.environ.get('APPDATA', Path.home())) / 'kroger-mcp'
|
|
32
|
+
else: # Unix-like
|
|
33
|
+
token_dir = Path(os.environ.get('XDG_DATA_HOME', Path.home() / '.local' / 'share')) / 'kroger-mcp'
|
|
34
|
+
|
|
35
|
+
token_dir.mkdir(parents=True, exist_ok=True)
|
|
36
|
+
return str(token_dir / token_name)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
13
40
|
|
|
14
41
|
def save_token(token_info: Dict[str, Any], token_file: str = TOKEN_FILE) -> None:
|
|
15
42
|
"""
|
|
@@ -19,6 +46,10 @@ def save_token(token_info: Dict[str, Any], token_file: str = TOKEN_FILE) -> None
|
|
|
19
46
|
token_info: The token information returned from the API
|
|
20
47
|
token_file: The file path to save the token to
|
|
21
48
|
"""
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
token_file = get_token_file_path(token_file)
|
|
52
|
+
|
|
22
53
|
# Save to file
|
|
23
54
|
with open(token_file, "w") as f:
|
|
24
55
|
json.dump(token_info, f, indent=2)
|
|
@@ -37,6 +68,9 @@ def load_token(token_file: str = TOKEN_FILE) -> Optional[Dict[str, Any]]:
|
|
|
37
68
|
Returns:
|
|
38
69
|
The token information or None if not available
|
|
39
70
|
"""
|
|
71
|
+
|
|
72
|
+
token_file = get_token_file_path(token_file)
|
|
73
|
+
|
|
40
74
|
if not os.path.exists(token_file):
|
|
41
75
|
return None
|
|
42
76
|
|
|
@@ -58,6 +92,10 @@ def clear_token(token_file: str = TOKEN_FILE) -> None:
|
|
|
58
92
|
Args:
|
|
59
93
|
token_file: The file path to delete
|
|
60
94
|
"""
|
|
95
|
+
|
|
96
|
+
token_file = get_token_file_path(token_file)
|
|
97
|
+
|
|
98
|
+
|
|
61
99
|
if os.path.exists(token_file):
|
|
62
100
|
os.remove(token_file)
|
|
63
101
|
print("Token file deleted.")
|
|
@@ -73,6 +111,9 @@ def get_refresh_token(token_file: str = TOKEN_FILE) -> Optional[str]:
|
|
|
73
111
|
Returns:
|
|
74
112
|
The refresh token or None if not available
|
|
75
113
|
"""
|
|
114
|
+
|
|
115
|
+
token_file = get_token_file_path(token_file)
|
|
116
|
+
|
|
76
117
|
token_info = load_token(token_file)
|
|
77
118
|
|
|
78
119
|
if token_info and "refresh_token" in token_info:
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kroger-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A Python client library for the Kroger Public API
|
|
5
|
-
Home-page: https://github.com/CupOfOwls/kroger-api
|
|
6
|
-
Author: Stephen Thoemmes
|
|
7
5
|
Author-email: Stephen Thoemmes <thoemmes.stephen@gmail.com>
|
|
8
6
|
License: MIT License
|
|
9
7
|
|
|
@@ -61,10 +59,7 @@ Requires-Dist: flake8; extra == "dev"
|
|
|
61
59
|
Requires-Dist: mypy; extra == "dev"
|
|
62
60
|
Provides-Extra: examples
|
|
63
61
|
Requires-Dist: tabulate>=0.8.0; extra == "examples"
|
|
64
|
-
Dynamic: author
|
|
65
|
-
Dynamic: home-page
|
|
66
62
|
Dynamic: license-file
|
|
67
|
-
Dynamic: requires-python
|
|
68
63
|
|
|
69
64
|
# 🛒 Kroger Public API 🛍️ -- with Examples in Python 🐍
|
|
70
65
|
|
|
@@ -76,6 +71,8 @@ Adding an item to your cart via an interactive Python script, and checking that
|
|
|
76
71
|
|
|
77
72
|
https://github.com/user-attachments/assets/0079cbc7-5af0-473b-909a-d43508fe43d5
|
|
78
73
|
|
|
74
|
+
You can also check out [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp), which is an implementation of the Model Context Protocol leveraging this kroger-api package!
|
|
75
|
+
|
|
79
76
|
## 🚀 Quick Start
|
|
80
77
|
|
|
81
78
|
### Installation
|
|
@@ -175,9 +172,15 @@ This library implements robust, automatic token management:
|
|
|
175
172
|
2. On 401 Unauthorized errors, attempts token refresh
|
|
176
173
|
3. Retries original request with new token
|
|
177
174
|
|
|
178
|
-
Token files (automatically managed
|
|
175
|
+
Token files (automatically managed):
|
|
179
176
|
- `.kroger_token_client_product.compact.json` - Client credentials tokens
|
|
180
177
|
- `.kroger_token_user.json` - User authorization tokens
|
|
178
|
+
These tokens are stored in the first matching location:
|
|
179
|
+
1. `$KROGER_TOKEN_DIR` — set this environment variable to choose the directory yourself
|
|
180
|
+
2. `$XDG_DATA_HOME/kroger-mcp/` (defaults to `~/.local/share/kroger-mcp/`) on Unix-like machines (macOS, Linux)
|
|
181
|
+
3. `%APPDATA%\kroger-mcp\` on Windows
|
|
182
|
+
|
|
183
|
+
The directory is shared with the [kroger-mcp](https://github.com/CupOfOwls/kroger-mcp) package so both reuse the same tokens, and it is always writable even when the process is launched with a read-only working directory (e.g. MCP servers under Claude Desktop on Windows).
|
|
181
184
|
|
|
182
185
|
### 🔒 Enhanced Security with PKCE
|
|
183
186
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
CHANGELOG.md
|
|
2
1
|
LICENSE
|
|
3
2
|
MANIFEST.in
|
|
4
3
|
README.md
|
|
5
4
|
pyproject.toml
|
|
6
5
|
requirements.txt
|
|
7
|
-
setup.py
|
|
8
|
-
assets/kroger-api-python-add-to-cart-demo.mp4
|
|
9
|
-
assets/product_api_script.gif
|
|
10
6
|
examples/authorization_api_examples.py
|
|
11
7
|
examples/cart_api_examples.py
|
|
12
8
|
examples/clear_tokens.py
|
|
@@ -23,7 +19,6 @@ kroger_api/token_storage.py
|
|
|
23
19
|
kroger_api.egg-info/PKG-INFO
|
|
24
20
|
kroger_api.egg-info/SOURCES.txt
|
|
25
21
|
kroger_api.egg-info/dependency_links.txt
|
|
26
|
-
kroger_api.egg-info/not-zip-safe
|
|
27
22
|
kroger_api.egg-info/requires.txt
|
|
28
23
|
kroger_api.egg-info/top_level.txt
|
|
29
24
|
kroger_api/api/__init__.py
|
|
@@ -34,6 +29,8 @@ kroger_api/api/location.py
|
|
|
34
29
|
kroger_api/api/product.py
|
|
35
30
|
kroger_api/auth/__init__.py
|
|
36
31
|
kroger_api/auth/interactive.py
|
|
32
|
+
kroger_api/tests/test_auth.py
|
|
33
|
+
kroger_api/tests/test_client.py
|
|
37
34
|
kroger_api/utils/__init__.py
|
|
38
35
|
kroger_api/utils/env.py
|
|
39
36
|
kroger_api/utils/oauth.py
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -33,7 +33,7 @@ dependencies = [
|
|
|
33
33
|
"certifi>=2021.0.0",
|
|
34
34
|
"urllib3>=1.26.0",
|
|
35
35
|
]
|
|
36
|
-
|
|
36
|
+
version = "0.3.0"
|
|
37
37
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
39
|
dev = [
|
|
@@ -58,4 +58,3 @@ Documentation = "https://developer.kroger.com/documentation/public/"
|
|
|
58
58
|
[tool.setuptools.packages.find]
|
|
59
59
|
exclude = ["tests*", "docs_kroger_api*", "venv*", "examples*", "assets*"]
|
|
60
60
|
|
|
61
|
-
[tool.setuptools_scm]
|
kroger_api-0.2.0/CHANGELOG.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `kroger-api` package will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [0.2.0] - 2025-05-28
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
|
|
12
|
-
- **PKCE Support**: Added Proof Key for Code Exchange (PKCE) support for enhanced security in the OAuth flow
|
|
13
|
-
- New `code_challenge` and `code_challenge_method` parameters in `get_authorization_url()`
|
|
14
|
-
- New `code_verifier` parameter in `get_token_with_authorization_code()`
|
|
15
|
-
- New utility module `pkce.py` with helper functions:
|
|
16
|
-
- `generate_code_verifier()`: Generate a random code verifier
|
|
17
|
-
- `generate_code_challenge()`: Generate a code challenge from a code verifier
|
|
18
|
-
- `generate_pkce_parameters()`: Generate all PKCE parameters in one call
|
|
19
|
-
|
|
20
|
-
### Security
|
|
21
|
-
|
|
22
|
-
- Enhanced OAuth security with PKCE support, mitigating authorization code interception attacks
|
|
23
|
-
- Improved token exchange with better error handling for PKCE flows
|
|
24
|
-
|
|
25
|
-
## [0.1.0] - 2025-05-23
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
|
|
29
|
-
- Initial release of the Kroger API client library
|
|
30
|
-
- Support for OAuth 2.0 authorization code flow and client credentials flow
|
|
31
|
-
- API access for products, locations, cart, identity, and more
|
|
32
|
-
- Token storage and automatic refresh
|
|
33
|
-
- Flexible token management with custom file paths
|
|
34
|
-
- Example scripts for common use cases
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
kroger_api-0.2.0/setup.py
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
# Read the contents of README file
|
|
5
|
-
this_directory = os.path.abspath(os.path.dirname(__file__))
|
|
6
|
-
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
|
7
|
-
long_description = f.read()
|
|
8
|
-
|
|
9
|
-
setup(
|
|
10
|
-
name="kroger-api",
|
|
11
|
-
version="0.2.0",
|
|
12
|
-
packages=find_packages(exclude=['tests*', 'docs_kroger_api*', 'venv*', 'examples*', 'assets*']),
|
|
13
|
-
|
|
14
|
-
# Dependencies
|
|
15
|
-
install_requires=[
|
|
16
|
-
"requests>=2.25.0",
|
|
17
|
-
"python-dotenv>=0.15.0",
|
|
18
|
-
"certifi>=2021.0.0",
|
|
19
|
-
"urllib3>=1.26.0",
|
|
20
|
-
],
|
|
21
|
-
|
|
22
|
-
# Optional dependencies for development/examples
|
|
23
|
-
extras_require={
|
|
24
|
-
'dev': [
|
|
25
|
-
'pytest>=7.0.0',
|
|
26
|
-
'pytest-mock>=3.0.0',
|
|
27
|
-
'requests-mock>=1.9.0',
|
|
28
|
-
'black',
|
|
29
|
-
'flake8',
|
|
30
|
-
'mypy',
|
|
31
|
-
],
|
|
32
|
-
'examples': [
|
|
33
|
-
'tabulate>=0.8.0',
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
# Metadata
|
|
38
|
-
author="Stephen Thoemmes",
|
|
39
|
-
author_email="thoemmes.stephen@gmail.com",
|
|
40
|
-
description="A Python client library for the Kroger Public API",
|
|
41
|
-
long_description=long_description,
|
|
42
|
-
long_description_content_type="text/markdown",
|
|
43
|
-
keywords="kroger, api, grocery, shopping, retail",
|
|
44
|
-
url="https://github.com/CupOfOwls/kroger-api",
|
|
45
|
-
project_urls={
|
|
46
|
-
"Bug Reports": "https://github.com/CupOfOwls/kroger-api/issues",
|
|
47
|
-
"Source": "https://github.com/CupOfOwls/kroger-api",
|
|
48
|
-
"Kroger API Documentation": "https://developer.kroger.com/documentation/public/",
|
|
49
|
-
"Demo Video": "https://github.com/CupOfOwls/kroger-api/blob/main/assets/kroger-api-python-add-to-cart-demo.mp4",
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
# Classifiers for PyPI
|
|
53
|
-
classifiers=[
|
|
54
|
-
"Development Status :: 4 - Beta",
|
|
55
|
-
"Intended Audience :: Developers",
|
|
56
|
-
"License :: OSI Approved :: MIT License",
|
|
57
|
-
"Operating System :: OS Independent",
|
|
58
|
-
"Programming Language :: Python :: 3",
|
|
59
|
-
"Programming Language :: Python :: 3.8",
|
|
60
|
-
"Programming Language :: Python :: 3.9",
|
|
61
|
-
"Programming Language :: Python :: 3.10",
|
|
62
|
-
"Programming Language :: Python :: 3.11",
|
|
63
|
-
"Programming Language :: Python :: 3.12",
|
|
64
|
-
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
65
|
-
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
66
|
-
"Topic :: Office/Business",
|
|
67
|
-
],
|
|
68
|
-
|
|
69
|
-
# Python version requirement
|
|
70
|
-
python_requires=">=3.8",
|
|
71
|
-
|
|
72
|
-
# Include additional files (controlled by MANIFEST.in)
|
|
73
|
-
include_package_data=True,
|
|
74
|
-
zip_safe=False,
|
|
75
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|