Just a quick share for anyone building APIs or living in the Python backend trenches. I’ve been going through a brilliant series by sanjeev thiyagarajan that covers a wide sweep of the real-world stack: API design, FastAPI, testing, CI/CD, deployment, and all the unglamorous bits people usually skip. What I like most is that it’s practical. No theory marathons. Just clear, step-by-step building with production thinking baked in. If you’re working with FastAPI or planning to, this is a solid rabbit hole to fall into. https://lnkd.in/eeyDKhRp Enjoy
API Design with FastAPI: Practical Guide by Sanjeev Thiyagarajan
More Relevant Posts
-
Most data engines serialize data across process boundaries every time a Python User-Defined Function runs. Think Spark shipping rows to a separate Python process and back. Long ago, we eliminated that boundary entirely in Sail. Rust + PyO3 + Arrow, same process, zero copy.
To view or add a comment, sign in
-
Stop "Awaiting" Everything: The Hidden Cost of Async Python 🐍 Is your Python codebase turning "Red"? In the world of FastAPI and modern web frameworks, we’ve fallen into a trap: the belief that prefixing every function with async makes our code "faster." But if you’re using async for simple logic or CPU-heavy tasks, you might actually be: 1. Adding "Micro-Stalling": Forcing simple logic through the event loop's scheduling machinery actually slows it down. 2. Hogging the Loop: One CPU-bound "async" function can freeze your entire server. 3, Increasing Cognitive Load: When everything is awaitable, nothing stands out as a genuine I/O bottleneck. I just wrote a deep dive on why "Sync" is often the superior choice for internal logic, data science, and simple utility functions. Check out the full breakdown here:
To view or add a comment, sign in
-
When using asynchronous #python calls (good idea, especially for #LLM), changing just a single line of code can make it significantly faster by using uvloop https://lnkd.in/dtHxihe6
To view or add a comment, sign in
-
🚀 Day 34 of #100DaysOfCode | Scenario-Based Questions in Python OOP Today I practiced solving scenario-based problems using Python Object-Oriented Programming (OOP). These problems help in understanding how OOP concepts are applied in real-world situations. Key Concepts I Practiced: • Designing classes based on real-world scenarios • Implementing Encapsulation to protect class data • Using Inheritance to reuse code between classes • Applying Polymorphism for flexible and reusable methods Practising scenario-based questions improves logical thinking and problem-solving skills, and helps in building scalable and maintainable applications using OOP concepts. GitHub Repository: https://lnkd.in/gTmfXrWP #Python #OOPS #100DaysOfCode #CodingJourney #PythonProjects
To view or add a comment, sign in
-
Dockerfiles Are Runtime Contracts A Dockerfile isn’t just a file that builds an image. It defines the exact conditions under which your application is allowed to run. That makes it a contract. If you write: FROM python:latest you’re saying: “I’m okay with my runtime changing without me noticing.” If you don’t pin versions, you’re accepting silent upgrades If you copy everything blindly, you’re accepting unnecessary size and risk If you run as root, you’re expanding your attack surface. A good Dockerfile answers three questions clearly: • What exact environment does this app need? • What does it not need? • Can this run the same way tomorrow as it does today? Containers don’t guarantee stability Clear contracts do. #docker #softwareengineering
To view or add a comment, sign in
-
💻 Docker Practice: Optimizing Image Size Today I practiced reducing the footprint of my Docker images by switching to a lightweight base. 💠 Base Image Swap: Switched the Dockerfile from a standard slim image to python:3.12-alpine. 💠 Efficient Packaging: Rebuilt the application (optimizedapp) to see the impact on storage. 💠 Result Analysis: Successfully shrunk the image size from 183MB down to just 72.5MB. 💠 Verification: Ran the container to ensure the Alpine-based environment still executes the Python script perfectly. #Docker #Optimization #AlpineLinux #DevOps #CloudComputing #Efficiency #Backend
To view or add a comment, sign in
-
-
✅ Create Virtual Environment Using Ctrl + Shift + P (VS Code) 🔹 Step 1: Open Your Project Folder in VS Code Make sure your project contains: Your Python files (Optional) requirements.txt 🔹 Step 2: Open Command Palette Press: Ctrl + Shift + P 🔹 Step 3: Type Python: Create Environment Click it ✅ 🔹 Step 4: Choose Environment Type You will see options like: Venv Conda Choose Venv. 🔹 Step 5: Choose Python Interpreter Select the Python version you want (for example Python 3.10). VS Code will: ✔ Create .venv folder ✔ Automatically activate it ✔ Select interpreter 📦 Install From requirements.txt Automatically If your project has requirements.txt, VS Code will usually detect it and ask: “Install dependencies from requirements.txt?” Click Yes ✅ It will install all packages for you.
To view or add a comment, sign in
-
𝗜 𝗕𝗎𝗶𝗹𝗍 𝗔 𝗣𝗶𝗽-𝗜𝗻𝘀𝘁𝗮𝗹𝗹𝗮𝗯𝗹𝗲 𝗥𝗔𝗚 𝗖𝗵𝗮𝘁𝗯𝗼𝘁 You can chat with any document in 3 lines of Python. I turned my document Q&A chatbot into a proper Python package with a clean API and CLI. Here's how it works: - You install the package using pip - You import the DocumentQA class - You use the class to index your documents and ask questions You can use it inside a Flask API, run it from the command line, or import it into a Jupyter notebook. You can ask questions like "What are the payment terms?" and get answers from your documents. I pulled the RAG pipeline into a clean DocumentQA class. The key design decisions include: - Auto-detecting file types from extensions - Building conversation memory into the class - Creating a dual mode that works as general chat without any files, and RAG mode with files You can try it out by running pip install docqa-rag and then using the docqa command with your document. Source: https://lnkd.in/gqQErNVG
To view or add a comment, sign in
-
𝗣𝘆𝘁𝗵𝗼𝗻 𝗚𝘂𝗻𝗶𝗰𝗼𝗿𝗻 𝗶𝗻𝘁𝗲𝗿𝗻𝗮𝗹𝘀 – 𝗦𝘁𝗲𝗽-𝗯𝘆-𝘀𝘁𝗲𝗽 𝘄𝗮𝗹𝗸𝘁𝗵𝗿𝗼𝘂𝗴𝗵 Have you ever asked yourself how Gunicorn works internally? How does it actually serve your application? What exactly happens when you run the command `gunicorn module:app`? Gunicorn is a Python web server with millions of downloads and is used in production by many Python applications. If you’re curious about its internal workings—like a code walkthrough of what happens at each step, from running the Gunicorn command to handling a client request—this repo walks you through all of it, with references to the actual Gunicorn source code. In particular, it may be useful if you: - use Gunicorn in production and want a clearer mental model of its internals - are curious about process models, worker management, and request handling - want to learn from a real-world, battle-tested code base - enjoy reading source code and understanding why certain architectural decisions were made Start reading by clicking here: https://lnkd.in/ednj284z
To view or add a comment, sign in
-
-
Many of us are now coding with the help of LLMs, where the bottleneck has shifted to code review. We have to make sure the forced TDD approach really is testing what we want, and that the LLM didn’t bullshit us with fake assertions. It’s about truly understanding that our code works. From that struggle, I decided to create an open-source Python testing library, which also includes an MCP server. It allows you to specify the intent of your tests semantically! Take a look at the example code:
To view or add a comment, sign in
-
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development