Skip to content

Commit 405a938

Browse files
committed
fix: Update API response handling and disable test_webhook
Critical fixes based on QA assessment and backend API verification: API Contract Fixes: - Fix list() to handle unwrapped array responses from API - Fix get() to handle direct object responses (not wrapped) - Fix create() to handle direct object responses - Fix update() to handle direct object responses - API returns arrays/objects directly, not wrapped in {alerts:[]} or {alert:{}} - Added isinstance() checks to detect response format testWebhook() Changes: - Disable test_webhook() method - endpoint doesn't exist in backend - Backend only has /v1/alerts/test (tests alert conditions, not webhooks) - Method now raises NotImplementedError with clear message - Updated tests to expect NotImplementedError - Added documentation pointing to alternative endpoint Test Updates: - Updated webhook tests to expect NotImplementedError - All 21 tests passing (2 skipped - pandas) - 74% coverage on alerts resource Verified Against Backend: - Checked actual controller responses (PriceAlertSerializer) - Confirmed API returns unwrapped responses - Verified routes.rb shows no test_webhook endpoint Impact: Prevents 100% failure rate on list/get/create/update operations
1 parent 86bd6b4 commit 405a938

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3757
-110
lines changed

AWESOME_LISTS_SUBMISSIONS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Perfect for:
207207
- Data science projects
208208
- Academic research
209209

210-
Free tier includes 1,000 requests/month. Would love feedback from the community!
210+
Free tier includes 100 requests (lifetime). Would love feedback from the community!
211211
```
212212

213213
**Best Time to Post:** Tuesday-Thursday, 9-11am EST
@@ -296,7 +296,7 @@ Get current Brent Crude price:
296296
📈 Financial modeling
297297
🎓 Academic research
298298
299-
Free tier: 1,000 requests/month
299+
Free tier: 100 requests (lifetime)
300300
PyPI: pypi.org/project/oilpriceapi/
301301
GitHub: github.com/oilpriceapi/python-sdk
302302

BACKLINK_IMPROVEMENTS_SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This document summarizes the backlink and SEO enhancements made to the OilPriceA
3535
- 📊 Historical data for trend analysis
3636
- 🔒 99.9% uptime
3737
- 🚀 5-minute integration
38-
- 💰 Free tier with 1,000 requests/month
38+
- 💰 Free tier with 100 requests (lifetime)
3939

4040
**[Start Free →](https://oilpriceapi.com/auth/signup)** | **[View Pricing →](https://oilpriceapi.com/pricing)** | **[Read Docs →](https://docs.oilpriceapi.com)**
4141
```

GAP_ANALYSIS_SR_QA_ENGINEER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Shows specific error handling examples with fallback behavior
235235
### 10. REALISTIC FREE TIER EXAMPLES (🟢 MINOR GAP)
236236

237237
**Post Claims:**
238-
- "1,000 requests/month = 33/day. Good for:"
238+
- "100 requests (lifetime) = 33/day. Good for:"
239239
- Specific use case breakdowns
240240

241241
**Actual Implementation:**

MARKETING_ACTION_PLAN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ git push
5757
Official Python SDK for OilPriceAPI with Pandas integration, async support, and CLI tools.
5858
Get real-time and historical oil & energy commodity prices for trading and financial analysis.
5959
Features: DataFrame support, technical indicators (SMA, RSI, MACD), smart caching,
60-
rate limit handling. Free tier: 1,000 requests/month.
60+
rate limit handling. Free tier: 100 requests (lifetime).
6161
```
6262

6363
### 4. Email PyCoder's Weekly (3 minutes)
@@ -81,7 +81,7 @@ Official Python SDK for real-time and historical commodity price data. Features:
8181
- Smart caching and rate limit handling
8282
8383
Perfect for energy traders, financial analysts, and data scientists.
84-
Free tier: 1,000 requests/month.
84+
Free tier: 100 requests (lifetime).
8585
8686
Thanks for considering!
8787
OilPriceAPI Team
@@ -138,7 +138,7 @@ print(df.describe())
138138
- Data science projects
139139
- Academic research
140140

141-
Free tier: 1,000 requests/month. Feedback welcome!
141+
Free tier: 100 requests (lifetime). Feedback welcome!
142142
```
143143

144144
### 6. Submit to awesome-quant (5 minutes)
@@ -186,7 +186,7 @@ pip install oilpriceapi
186186
✅ Technical indicators
187187
✅ CLI tool
188188
189-
Free tier: 1K requests/month
189+
Free tier: 100 requests (lifetime)
190190
191191
PyPI: https://pypi.org/project/oilpriceapi/
192192
Docs: https://docs.oilpriceapi.com/sdk/python

POST_ON_SATURDAY.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# IMPORTANT: Post to r/Python on SATURDAY
2+
3+
**Date:** 2025-11-25 (Tuesday)
4+
**Action Required:** Post this Saturday (November 29 or 30, 2025)
5+
6+
---
7+
8+
## ⚠️ CRITICAL RULE: [P] Posts Only Allowed on Saturdays
9+
10+
From r/Python rules:
11+
> **Project posts ([P] flair) can ONLY be posted on Saturdays**
12+
13+
**This means:**
14+
- ❌ Tuesday-Thursday 9-11am EST is WRONG
15+
- ✅ Saturday 9-11am EST is CORRECT
16+
17+
**Next Saturday opportunities:**
18+
- November 29, 2025 (this Saturday)
19+
- December 6, 2025 (next Saturday if you miss this one)
20+
21+
---
22+
23+
## What's Ready
24+
25+
**Reddit post created:** `/home/kwaldman/code/sdks/python/REDDIT_POST_COPY_PASTE.md`
26+
**Real usage data:** 250+ PyPI downloads, 4 active users, 100+ API requests
27+
**Async verified:** Both sync and async examples in post
28+
**All claims verified:** Exponential backoff with jitter, connection pooling, error handling
29+
30+
---
31+
32+
## Pre-Post Checklist (Run on Saturday Morning)
33+
34+
**Saturday morning before posting:**
35+
36+
- [ ] Test Quick Start command works:
37+
```bash
38+
pip install oilpriceapi
39+
export OILPRICEAPI_KEY="your_test_key"
40+
python -c "from oilpriceapi import OilPriceAPI; print('Works!')"
41+
```
42+
43+
- [ ] Verify all links in incognito:
44+
- https://pypi.org/project/oilpriceapi/
45+
- https://github.com/oilpriceapi/python-sdk
46+
- https://docs.oilpriceapi.com/sdk/python
47+
48+
- [ ] Turn on GitHub notifications
49+
50+
- [ ] Clear 2 hours in calendar for responses
51+
52+
- [ ] Open prepared answers: `REDDIT_POST_FINAL.md` lines 177-205
53+
54+
---
55+
56+
## How to Post on Saturday
57+
58+
1. **Go to:** https://www.reddit.com/r/Python/submit
59+
2. **Click:** "Text" tab
60+
3. **Copy title from:** `REDDIT_POST_COPY_PASTE.md` line 3
61+
```
62+
[P] Built a Python SDK for commodity price data - handling retries, rate limits, and async properly
63+
```
64+
4. **Copy body from:** `REDDIT_POST_COPY_PASTE.md` lines 8-152
65+
5. **Select flair:** "[P]" (Project)
66+
6. **Post time:** Saturday 9-11am EST
67+
7. **Stay online** for first 2 hours
68+
69+
---
70+
71+
## Why Saturday?
72+
73+
r/Python has specific rules:
74+
- **[P] Project posts:** Saturdays only
75+
- **[D] Discussion:** Any day
76+
- **[Q] Questions:** Any day
77+
- **[N] News:** Any day
78+
79+
Since this is a project announcement, it MUST be Saturday with [P] flair.
80+
81+
---
82+
83+
## If You Accidentally Post Early
84+
85+
If you post Tuesday-Thursday:
86+
1. Post will be removed by moderators
87+
2. You'll be told to repost on Saturday
88+
3. You lose momentum and have to start over
89+
90+
**Don't post until Saturday!**
91+
92+
---
93+
94+
## Reminder for Saturday
95+
96+
**Copy this to your calendar:**
97+
98+
```
99+
SATURDAY - Post Python SDK to r/Python
100+
Time: 9-11am EST
101+
File: /home/kwaldman/code/sdks/python/REDDIT_POST_COPY_PASTE.md
102+
Link: https://www.reddit.com/r/Python/submit
103+
Flair: [P] (Project)
104+
Stay online: First 2 hours to respond to comments
105+
```
106+
107+
---
108+
109+
## Expected Response (Saturday)
110+
111+
**First hour:**
112+
- 10+ upvotes = good start
113+
- 5+ comments = sparking discussion
114+
- 2+ technical questions = right audience
115+
116+
**24 hours:**
117+
- 100+ upvotes = strong engagement
118+
- 20+ comments = real interest
119+
- 5+ GitHub stars = converted to users
120+
121+
**1 week:**
122+
- 500+ PyPI downloads = validation
123+
- 3+ issues/PRs = community building
124+
125+
---
126+
127+
## Post-Saturday Actions
128+
129+
**After posting:**
130+
1. Reply to comments within 15 minutes
131+
2. Link to specific code when explaining
132+
3. Thank people who ask questions
133+
4. Open GitHub issues for feature requests
134+
5. Query production DB again next week to see Reddit impact
135+
136+
---
137+
138+
**Status:** ✅ READY FOR SATURDAY
139+
**File:** /home/kwaldman/code/sdks/python/REDDIT_POST_COPY_PASTE.md
140+
**Next action:** Wait until Saturday, then post!

0 commit comments

Comments
 (0)