|
2 | 2 | import Layout from '../layouts/Layout.astro'; |
3 | 3 |
|
4 | 4 | const examples = [ |
5 | | - // LLM & AI |
6 | | - { |
7 | | - title: 'openai_gpt-example.py', |
8 | | - description: 'Chat completions, streaming, function calling, JSON mode with GPT-4', |
9 | | - category: 'LLM & AI', |
10 | | - tags: ['openai', 'gpt', 'chat', 'streaming'], |
11 | | - difficulty: 'intermediate' |
12 | | - }, |
13 | | - { |
14 | | - title: 'anthropic_claude-example.py', |
15 | | - description: 'Claude 3.5 integration with vision, streaming, and extended thinking', |
16 | | - category: 'LLM & AI', |
17 | | - tags: ['anthropic', 'claude', 'vision', 'ai'], |
18 | | - difficulty: 'intermediate' |
19 | | - }, |
20 | | - { |
21 | | - title: 'langchain-example.py', |
22 | | - description: 'LangChain framework: chains, memory, RAG, and prompt templates', |
23 | | - category: 'LLM & AI', |
24 | | - tags: ['langchain', 'rag', 'agents', 'chains'], |
25 | | - difficulty: 'advanced' |
26 | | - }, |
27 | | - { |
28 | | - title: 'instructor-example.py', |
29 | | - description: 'Type-safe structured outputs from LLMs using Pydantic', |
30 | | - category: 'LLM & AI', |
31 | | - tags: ['instructor', 'pydantic', 'structured', 'validation'], |
32 | | - difficulty: 'intermediate' |
33 | | - }, |
34 | 5 | // Network & APIs |
35 | 6 | { |
36 | 7 | title: 'grpcio-example.py', |
@@ -142,10 +113,10 @@ const totalExamples = examples.length; |
142 | 113 | <div class="abstract"> |
143 | 114 | <div class="abstract-title">Abstract</div> |
144 | 115 | <p> |
145 | | - This repository presents a comprehensive collection of Python examples demonstrating |
146 | | - modern development patterns, from cutting-edge LLM integrations to classic data processing. |
147 | | - Each example prioritizes security, type safety, and real-world applicability. |
148 | | - Built for developers who value clarity, efficiency, and getting things done. |
| 116 | + A curated collection of practical Python code examples covering web APIs, data processing, |
| 117 | + security tools, web scraping, and file manipulation. Each example is production-ready with |
| 118 | + proper error handling, security considerations, and clear documentation. Built by a developer |
| 119 | + who automates everything and believes good examples are better than lengthy tutorials. |
149 | 120 | </p> |
150 | 121 | </div> |
151 | 122 |
|
@@ -204,17 +175,27 @@ cd python-examples |
204 | 175 | # Install dependencies (using uv) |
205 | 176 | uv sync --dev |
206 | 177 |
|
207 | | -# Run an example |
| 178 | +# Run any example |
208 | 179 | cd python-examples |
209 | | -python openai_gpt-example.py</code></pre> |
| 180 | +python requests-example.py</code></pre> |
| 181 | + |
| 182 | + <h2>Why This Collection?</h2> |
| 183 | + <ul style="font-family: var(--font-sans); font-size: 1rem; line-height: 2; margin-left: 2rem;"> |
| 184 | + <li><strong>Copy-Paste Ready</strong> - Working code you can use immediately</li> |
| 185 | + <li><strong>Security Focused</strong> - Input validation, secure defaults, CodeQL verified</li> |
| 186 | + <li><strong>Modern Python 3.12+</strong> - Using latest features and best practices</li> |
| 187 | + <li><strong>Real-World Examples</strong> - Actual use cases, not toy demos</li> |
| 188 | + <li><strong>No Fluff</strong> - Code first, explanations when needed</li> |
| 189 | + </ul> |
210 | 190 |
|
211 | | - <h2>Features</h2> |
| 191 | + <h2>Popular Examples</h2> |
212 | 192 | <ul style="font-family: var(--font-sans); font-size: 1rem; line-height: 2; margin-left: 2rem;"> |
213 | | - <li><strong>Modern Python 3.12+</strong> - Leveraging latest language features</li> |
214 | | - <li><strong>Type Safety</strong> - Pydantic models and type hints throughout</li> |
215 | | - <li><strong>Security First</strong> - Input validation, secure defaults, CodeQL verified</li> |
216 | | - <li><strong>Production Ready</strong> - Error handling, logging, and best practices</li> |
217 | | - <li><strong>Well Documented</strong> - Clear docstrings and usage examples</li> |
| 193 | + <li><strong>gRPC</strong> - Modern RPC framework with protocol buffers</li> |
| 194 | + <li><strong>Flask</strong> - Web API with secure file uploads</li> |
| 195 | + <li><strong>Scrapy</strong> - Web scraping at scale</li> |
| 196 | + <li><strong>Tor Integration</strong> - Anonymous network access</li> |
| 197 | + <li><strong>Shodan API</strong> - Internet device search and OSINT</li> |
| 198 | + <li><strong>OpenCV</strong> - Computer vision and face detection</li> |
218 | 199 | </ul> |
219 | 200 |
|
220 | 201 | <footer class="site-footer"> |
|
0 commit comments