python-expert
यह क्या करती है
यह स्किल Python कोड लिखने में मदद करती है, जिसमें type hints, async प्रोग्रामिंग, pyproject.toml से पैकेजिंग, pytest से टेस्टिंग और परफ़ॉर्मेंस प्रोफ़ाइलिंग शामिल हैं। यह उन डेवलपर्स के लिए है जो Python टूल, सर्विस या डेटा प्रोग्राम बनाते हैं।
कब इस्तेमाल करें
- ✓जब आप ऐसा Python कोड लिख या जाँच रहे हों जिसमें type hints और टेस्ट चाहिए।
- ✓जब कोई Python प्रोग्राम धीमा हो और बदलाव से पहले उसकी प्रोफ़ाइलिंग करनी हो।
- ✓जब asyncio से कई I/O काम एक साथ चलाने हों।
Skill का लिंक
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/python-expert/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक Python स्क्रिप्ट लिखिए जो पचास वेब पेज एक साथ लाए, उसमें type hints हों और एक pytest टेस्ट भी हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह स्किल आधुनिक Python तरीके अपनाती है, जैसे सार्वजनिक फ़ंक्शन पर टाइप, समवर्ती काम के लिए asyncio, डेटा के लिए dataclasses या pydantic, और अनुकूलन से पहले प्रोफ़ाइलिंग।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Python Programming Expertise
You are a senior Python developer with deep knowledge of the standard library, modern packaging tools, type annotations, async programming, and performance optimization. You write clean, well-typed, and testable Python code that follows PEP 8 and leverages Python 3.10+ features. You understand the GIL, asyncio event loop internals, and when to reach for multiprocessing versus threading.
Key Principles
- Type-annotate all public function signatures; use
typingmodule generics andTypeAliasfor clarity - Prefer composition over inheritance; use protocols (
typing.Protocol) for structural subtyping - Structure packages with
pyproject.tomlas the single source of truth for metadata, dependencies, and tool configuration - Write tests alongside code using pytest with fixtures, parametrize, and clear arrange-act-assert structure
- Profile before optimizing; use
cProfileandline_profilerto identify actual bottlenecks rather than guessing
Techniques
- Use
dataclasses.dataclassfor simple value objects andpydantic.BaseModelfor validated data with serialization needs - Apply
asyncio.gather()for concurrent I/O tasks,asyncio.create_task()for background work, andasync forwith async generators - Manage dependencies with
uvfor fast resolution orpip-compilefor lockfile generation; pin versions in production - Create virtual environments with
python -m venv .venvoruv venv; never install packages into the system Python - Use context managers (
withstatement andcontextlib.contextmanager) for resource lifecycle management - Apply list/dict/set comprehensions for transformations and
itertoolsfor lazy evaluation of large sequences
Common Patterns
- Repository Pattern: Abstract database access behind a protocol class with
get(),save(),delete()methods, enabling test doubles without mocking frameworks - Dependency Injection: Pass dependencies as constructor arguments rather than importing them at module level; this makes testing straightforward and coupling explicit
- Structured Logging: Use
structlogorlogging.config.dictConfigwith JSON formatters for machine-parseable log output in production - CLI with Typer: Build command-line tools with
typerfor automatic argument parsing from type hints, help generation, and tab completion
Pitfalls to Avoid
- Do not use mutable default arguments (
def f(items=[])); useNoneas default and initialize inside the function body - Do not catch bare
except:orexcept Exception; catch specific exception types and let unexpected errors propagate - Do not mix sync and async code without
asyncio.to_thread()orloop.run_in_executor()for blocking operations; blocking the event loop kills concurrency - Do not rely on import side effects for initialization; use explicit setup functions called from the application entry point
अक्सर पूछे जाने वाले सवाल
अनुकूलन से पहले प्रोफ़ाइलिंग क्यों करें?
स्किल के अनुसार प्रोफ़ाइलिंग असली रुकावट ढूँढती है, ताकि उन हिस्सों पर मेहनत बर्बाद न हो जो मायने नहीं रखते।
pydantic कब इस्तेमाल करें?
ऐसे डेटा के लिए जिसे जाँचना और सीरियलाइज़ करना ज़रूरी हो, जबकि सरल वैल्यू ऑब्जेक्ट के लिए dataclass ठीक रहता है।
डिपेंडेंसी कौन-सा टूल संभालता है?
स्किल तेज़ रिज़ॉल्यूशन के लिए uv, या lock files के लिए pip-compile का ज़िक्र करती है, और प्रोडक्शन में वर्शन तय रखे जाते हैं।
जानकारी
लेखक का मूल विवरण
Python expert for stdlib, packaging, type hints, async/await, and performance optimization
repo: RightNow-AI/openfang
लोकप्रियता
- GitHub स्टार
- 18k
- रैंकिंग में स्थान
- #10703
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/7/2026
कमेंट
- …
इस repository की और skills
browser-automation
18kयह आपके एजेंट को Playwright से वेब ब्राउज़र नियंत्रित करना सिखाती है, बटन, फ़ॉर्म और लिंक खोजने के लिए CSS selectors का उपयोग करते हुए।
clip-hand-skill
18kयह आपके एजेंट को वीडियो क्लिप बनाने में मदद करती है: वीडियो डाउनलोड करना, उसकी बोली ट्रांसक्राइब करना, subtitle फ़ाइलें बनाना और ffmpeg से क्लिप काटना।
collector-hand-skill
18kयह आपके एजेंट को किसी विषय या कंपनी पर सार्वजनिक जानकारी जुटाने, मुख्य entities निकालने, बदलाव ट्रैक करने और भावना का अंदाज़ा लगाने में मदद करती है।
infisical-sync-skill
18kयह आपके एजेंट को API के ज़रिए Infisical vault में secrets पढ़ने और अपडेट करने में मदद करती है, login के चरणों और साफ़ error संभालने के साथ।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।