$ python-examples
A Curated Collection of Python Implementations
A curated collection of practical Python code examples covering modern LLM integrations, web APIs, data processing, security tools, web scraping, and file manipulation. Each example is production-ready with proper error handling, security considerations, and clear documentation. Built by a developer who automates everything and believes good examples are better than lengthy tutorials.
Examples
openai_gpt-example.py
Chat completions, streaming, function calling, JSON mode with GPT-4
anthropic_claude-example.py
Claude 3.5 integration with vision, streaming, and extended thinking
langchain-example.py
LangChain framework: chains, memory, RAG, and prompt templates
instructor-example.py
Type-safe structured outputs from LLMs using Pydantic
grpcio-example.py
gRPC client-server implementation with protocol buffers
requests-example.py
HTTP requests library examples for API interactions
flask-example.py
Flask web framework with file uploads and routing
scrapy-spider.py
Scrapy spider for crawling and extracting web data
bs4-example.py
BeautifulSoup HTML parsing and DOM manipulation
sentiment_analysis_nltk-example.py
NLTK sentiment analysis on text data
opencv_facial_recognition-example.py
OpenCV face detection and recognition
tor-example.py
Tor network integration for anonymous browsing
shodan-example.py
Shodan API for internet-connected device search
hashing_example.py
Cryptographic hashing with SHA-256 and other algorithms
pdfquery-example.py
PDF text extraction and querying
exif_reader-example.py
EXIF metadata extraction from images
Quick Start
# Clone the repository
git clone https://github.com/james-see/python-examples.git
cd python-examples
# Install dependencies (using uv)
uv sync --dev
# Run any example
cd python-examples
python requests-example.py Why This Collection?
- Copy-Paste Ready - Working code you can use immediately
- Security Focused - Input validation, secure defaults, CodeQL verified
- Modern Python 3.12+ - Using latest features and best practices
- Real-World Examples - Actual use cases, not toy demos
- No Fluff - Code first, explanations when needed
Popular Examples
- gRPC - Modern RPC framework with protocol buffers
- Flask - Web API with secure file uploads
- Scrapy - Web scraping at scale
- Tor Integration - Anonymous network access
- Shodan API - Internet device search and OSINT
- OpenCV - Computer vision and face detection
