Skip to content

Commit af97db2

Browse files
author
chriskh
committed
removing metadata
1 parent 29093ae commit af97db2

File tree

4 files changed

+21
-132
lines changed

4 files changed

+21
-132
lines changed

labs/workshops/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The script will automatically:
4949
2. **Local Jupyter (Local Mode)**
5050
```bash
5151
cd labs/workshops
52-
jupyter lab
52+
jupyter lab .
5353
```
5454

5555
## 📚 Available Challenges

labs/workshops/listings-wizard/00-low-conversion-challenge.ipynb

Lines changed: 19 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,12 @@
2929
{
3030
"cell_type": "code",
3131
"id": "ef145f6d-ce8c-4c21-804e-254ca8190350",
32-
"metadata": {
33-
"ExecuteTime": {
34-
"end_time": "2025-09-29T12:14:48.174450Z",
35-
"start_time": "2025-09-29T12:14:46.832477Z"
36-
}
37-
},
32+
"metadata": {},
3833
"source": [
3934
"pip install amzn-sp-api==1.2.0"
4035
],
41-
"outputs": [
42-
{
43-
"name": "stdout",
44-
"output_type": "stream",
45-
"text": [
46-
"Requirement already satisfied: amzn-sp-api==1.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (1.2.0)\r\n",
47-
"Requirement already satisfied: urllib3<3.0.0,>=2.1.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from amzn-sp-api==1.2.0) (2.3.0)\r\n",
48-
"Requirement already satisfied: certifi>=2025.1.31 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from amzn-sp-api==1.2.0) (2025.8.3)\r\n",
49-
"Requirement already satisfied: requests>=2.32.3 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from amzn-sp-api==1.2.0) (2.32.3)\r\n",
50-
"Requirement already satisfied: six>=1.17.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from amzn-sp-api==1.2.0) (1.17.0)\r\n",
51-
"Requirement already satisfied: charset-normalizer<4,>=2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from requests>=2.32.3->amzn-sp-api==1.2.0) (3.4.1)\r\n",
52-
"Requirement already satisfied: idna<4,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from requests>=2.32.3->amzn-sp-api==1.2.0) (3.10)\r\n",
53-
"\r\n",
54-
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m23.2.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m25.2\u001B[0m\r\n",
55-
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49m/usr/local/bin/python3 -m pip install --upgrade pip\u001B[0m\r\n",
56-
"Note: you may need to restart the kernel to use updated packages.\n"
57-
]
58-
}
59-
],
60-
"execution_count": 1
36+
"outputs": [],
37+
"execution_count": null
6138
},
6239
{
6340
"cell_type": "markdown",
@@ -83,12 +60,7 @@
8360
{
8461
"cell_type": "code",
8562
"id": "4b7d9770-ccdc-4edd-a910-242916c578f7",
86-
"metadata": {
87-
"ExecuteTime": {
88-
"end_time": "2025-09-29T12:15:13.908703Z",
89-
"start_time": "2025-09-29T12:15:13.887970Z"
90-
}
91-
},
63+
"metadata": {},
9264
"source": [
9365
"from spapi.models.datakiosk_v2023_11_15 import GetDocumentResponse, CreateQueryResponse, GetQueriesResponse, Query\n",
9466
"from spapi import SPAPIConfig, SPAPIClient, ApiException, QueriesApi, ListingsApi\n",
@@ -112,16 +84,8 @@
11284
"listings_api = ListingsApi(client.api_client)\n",
11385
"print(\"💻 API Client initiated\")"
11486
],
115-
"outputs": [
116-
{
117-
"name": "stdout",
118-
"output_type": "stream",
119-
"text": [
120-
"💻 API Client initiated\n"
121-
]
122-
}
123-
],
124-
"execution_count": 5
87+
"outputs": [],
88+
"execution_count": null
12589
},
12690
{
12791
"cell_type": "markdown",
@@ -153,27 +117,14 @@
153117
"- Submit custom queries\n",
154118
"- Check their status\n",
155119
"- Download results\n",
156-
" \n",
120+
"\n",
157121
"🙌 Time to get seller data with the power of GraphQL!"
158122
]
159123
},
160-
{
161-
"metadata": {},
162-
"cell_type": "code",
163-
"outputs": [],
164-
"execution_count": null,
165-
"source": "pip install pandas",
166-
"id": "6cc8eb127ee0292b"
167-
},
168124
{
169125
"cell_type": "code",
170126
"id": "7250c7cd-62cd-4ce3-9c40-db746184a37f",
171-
"metadata": {
172-
"ExecuteTime": {
173-
"end_time": "2025-09-29T12:15:50.137187Z",
174-
"start_time": "2025-09-29T12:15:49.991204Z"
175-
}
176-
},
127+
"metadata": {},
177128
"source": [
178129
"graphql_query_str = (\"query { analytics_economics_2024_03_15 { economics( marketplaceIds: [\\\"ATVPDKIKX0DER\\\"], \"\n",
179130
" \"startDate: \\\"2025-06-01\\\", endDate: \\\"2025-06-05\\\", \"\n",
@@ -240,61 +191,8 @@
240191
"plt.tight_layout()\n",
241192
"plt.show()\n"
242193
],
243-
"outputs": [
244-
{
245-
"name": "stdout",
246-
"output_type": "stream",
247-
"text": [
248-
"📃 Query: \n",
249-
" query { analytics_economics_2024_03_15 { economics( marketplaceIds: [\"ATVPDKIKX0DER\"], startDate: \"2025-06-01\", endDate: \"2025-06-05\", aggregateBy: { date: DAY, productId: MSKU } ) { startDate endDate msku marketplaceId sales { unitsOrdered netUnitsSold netProductSales { amount currencyCode } } netProceeds { total { amount currencyCode } } } } }\n",
250-
"✅ Query submitted! Response: {'query_id': '1000001'}\n",
251-
"⏱️ Query status: {'created_time': datetime.datetime(2025, 7, 17, 11, 25, 13, 645000, tzinfo=tzutc()),\n",
252-
" 'data_document_id': 'usecase_1_document_id.amzn.100001',\n",
253-
" 'error_document_id': None,\n",
254-
" 'pagination': None,\n",
255-
" 'processing_end_time': datetime.datetime(2025, 7, 17, 11, 25, 13, 645000, tzinfo=tzutc()),\n",
256-
" 'processing_start_time': datetime.datetime(2025, 7, 17, 11, 25, 13, 645000, tzinfo=tzutc()),\n",
257-
" 'processing_status': 'DONE',\n",
258-
" 'query': 'query { analytics_economics_2024_03_15 { economics( marketplaceIds: '\n",
259-
" '[\"ATVPDKIKX0DER\"], startDate: \"2025-06-01\", endDate: \"2025-06-05\", '\n",
260-
" 'aggregateBy: { date: DAY, productId: MSKU } ) { startDate endDate '\n",
261-
" 'msku marketplaceId sales { unitsOrdered netUnitsSold '\n",
262-
" 'netProductSales { amount currencyCode } } netProceeds { total { '\n",
263-
" 'amount currencyCode } } } } }',\n",
264-
" 'query_id': '1000001'}\n",
265-
"📊 Here's your data: {'document_id': 'usecase_1_document_id.amzn.100001',\n",
266-
" 'document_url': \"{'data': {'analytics_economics_2024_03_15': {'economics': \"\n",
267-
" \"[{'startDate': '2025-06-01', 'endDate': '2025-06-01', \"\n",
268-
" \"'msku': 'MOTOR-GEAR-US', 'marketplaceId': 'ATVPDKIKX0DER', \"\n",
269-
" \"'sales': {'unitsOrdered': 0, 'netUnitsSold': 0, \"\n",
270-
" \"'netProductSales': {'amount': 0.0, 'currencyCode': 'USD'}}, \"\n",
271-
" \"'netProceeds': {'total': {'amount': 0.0, 'currencyCode': \"\n",
272-
" \"'USD'}}}, {'startDate': '2025-06-01', 'endDate': \"\n",
273-
" \"'2025-06-01', 'msku': 'MOTOR-GEAR-CA', 'marketplaceId': \"\n",
274-
" \"'A2EUQ1WTGCTBG2', 'sales': {'unitsOrdered': 50, \"\n",
275-
" \"'netUnitsSold': 50, 'netProductSales': {'amount': 1000.0, \"\n",
276-
" \"'currencyCode': 'CAD'}}, 'netProceeds': {'total': {'amount': \"\n",
277-
" \"800.0, 'currencyCode': 'CAD'}}}, {'startDate': '2025-06-01', \"\n",
278-
" \"'endDate': '2025-06-01', 'msku': 'MOTOR-GEAR-MX', \"\n",
279-
" \"'marketplaceId': 'A1AM78C64UM0Y8', 'sales': {'unitsOrdered': \"\n",
280-
" \"50, 'netUnitsSold': 50, 'netProductSales': {'amount': \"\n",
281-
" \"1000.0, 'currencyCode': 'Mex'}}, 'netProceeds': {'total': \"\n",
282-
" \"{'amount': 800.0, 'currencyCode': 'Mex'}}}]}}}\"}\n"
283-
]
284-
},
285-
{
286-
"ename": "ModuleNotFoundError",
287-
"evalue": "No module named 'pandas'",
288-
"output_type": "error",
289-
"traceback": [
290-
"\u001B[31m---------------------------------------------------------------------------\u001B[39m",
291-
"\u001B[31mModuleNotFoundError\u001B[39m Traceback (most recent call last)",
292-
"\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[6]\u001B[39m\u001B[32m, line 22\u001B[39m\n\u001B[32m 19\u001B[39m \u001B[38;5;28mprint\u001B[39m(\u001B[33m\"\u001B[39m\u001B[33m📊 Here\u001B[39m\u001B[33m'\u001B[39m\u001B[33ms your data:\u001B[39m\u001B[33m\"\u001B[39m, get_document)\n\u001B[32m 21\u001B[39m \u001B[38;5;28;01mimport\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mast\u001B[39;00m\n\u001B[32m---> \u001B[39m\u001B[32m22\u001B[39m \u001B[38;5;28;01mimport\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mpandas\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mas\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mpd\u001B[39;00m\n\u001B[32m 23\u001B[39m \u001B[38;5;28;01mimport\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mmatplotlib\u001B[39;00m\u001B[34;01m.\u001B[39;00m\u001B[34;01mpyplot\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mas\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mplt\u001B[39;00m\n\u001B[32m 25\u001B[39m \u001B[38;5;66;03m# Safely convert the string to a dictionary\u001B[39;00m\n",
293-
"\u001B[31mModuleNotFoundError\u001B[39m: No module named 'pandas'"
294-
]
295-
}
296-
],
297-
"execution_count": 6
194+
"outputs": [],
195+
"execution_count": null
298196
},
299197
{
300198
"cell_type": "markdown",
@@ -327,10 +225,8 @@
327225
},
328226
{
329227
"cell_type": "code",
330-
"execution_count": null,
331228
"id": "b1b36cbd-ca0a-4e4f-8e9f-edfc49fa053a",
332229
"metadata": {},
333-
"outputs": [],
334230
"source": [
335231
"import json\n",
336232
"get_listing = listings_api.get_listings_item('AMY7FKRUBY7XV', \n",
@@ -339,7 +235,9 @@
339235
" included_data=['issues'])\n",
340236
"\n",
341237
"print(\"🛍️ Here's your listing: \\n\", json.dumps(get_listing.to_dict(), indent=4, default=str))"
342-
]
238+
],
239+
"outputs": [],
240+
"execution_count": null
343241
},
344242
{
345243
"cell_type": "markdown",
@@ -454,10 +352,8 @@
454352
},
455353
{
456354
"cell_type": "code",
457-
"execution_count": null,
458355
"id": "37f273da-1ba6-4698-b4f1-7d1db92d2a26",
459356
"metadata": {},
460-
"outputs": [],
461357
"source": [
462358
"import json\n",
463359
"body = {\n",
@@ -478,15 +374,17 @@
478374
"} \n",
479375
"patch_listing = listings_api.patch_listings_item('AMY7FKRUBY7XV', 'MOTOR-GEAR-US',['ATVPDKIKX0DER'], body)\n",
480376
"print(\"💾 Submission result: \\n\", json.dumps(patch_listing.to_dict(), indent=4, default=str))"
481-
]
377+
],
378+
"outputs": [],
379+
"execution_count": null
482380
},
483381
{
484382
"metadata": {},
485383
"cell_type": "code",
486-
"outputs": [],
487-
"execution_count": null,
488384
"source": "",
489-
"id": "207ce43df479a203"
385+
"id": "207ce43df479a203",
386+
"outputs": [],
387+
"execution_count": null
490388
}
491389
],
492390
"metadata": {

labs/workshops/listings-wizard/02-high-refund-challenge.ipynb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,6 @@
124124
"\n"
125125
]
126126
},
127-
{
128-
"metadata": {},
129-
"cell_type": "code",
130-
"outputs": [],
131-
"execution_count": null,
132-
"source": "pip install pandas",
133-
"id": "126758787e6eddb2"
134-
},
135127
{
136128
"cell_type": "code",
137129
"execution_count": null,

labs/workshops/listings-wizard/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ You can run these notebooks on **Amazon SageMaker → Notebook Instances**
4242

4343
**OR** run them locally in any Jupyter environment:
4444
```bash
45-
git clone https://github.com/amzn/sp-api-sample-solutions.git
4645
cd labs/workshops/listings-wizard
4746
python3 -m venv venv
4847
source venv/bin/activate
4948
pip install -r requirements.txt
50-
jupyter lab
49+
jupyter lab .
5150
```
5251
---
5352

0 commit comments

Comments
 (0)