🚀 pyresilience — 7 resilience patterns in 1 decorator 💡 What is resilience? Your app keeps working even when dependencies fail, slow down, or overload. No crashes. No hanging. Just smart recovery. ⚠️ Pain point: Python teams often stitch together: • Retries ("tenacity") • Circuit breakers ("pybreaker") • Timeouts ("asyncio", "signal") • Rate limiting ("limits", "slowapi") • Fallbacks (custom code) 👉 These don’t coordinate → messy + inconsistent failure handling 📊 Existing tools: • "tenacity" (retries ~263.6M downloads/month) • "pybreaker" (circuit breaker ~9.6M downloads/month) 👉 Great individually, not unified ⚡pyresilience Benchmark: 🚀 pyresilience → 0.64 μs (🔥 ~10.4x faster) 🐢 tenacity → 6.64 μs 🛠️ What pyresilience does: One decorator with: ✅ Retry ✅ Circuit Breaker ✅ Timeout ✅ Fallback ✅ Bulkhead ✅ Rate Limiter ✅ Cache ➡️ Works together, not glued ➡️ Zero dependency ➡️ Sync + Async ➡️ High performance Frameworks: 🌐 FastAPI • Flask • Django 👨💻 For all Python developers 🔗 GitHub: https://lnkd.in/d-SRygNQ 🔗 PyPI: https://lnkd.in/dRg2H4D5 🔗 Docs: https://lnkd.in/dxZ4xYkw 💬 How are you handling resilience in Python today? #Python #SoftwareEngineering #BackendDevelopment #PythonDev #Microservices #DistributedSystems #FastAPI #Django #Flask #ResilienceEngineering #SystemDesign #FaultTolerance #OpenSource #DevTools #BuildInPublic
Ahsan Sheraz’s Post
More Relevant Posts
-
🚀 pyresilience — 7 resilience patterns in 1 decorator (~1000 downloads last month 🔥) 💡 What is resilience? Your app keeps working even when dependencies fail, slow down, or overload. No crashes. No hanging. Just smart recovery. ⚠️ Pain point: Python teams often stitch together: • Retries ("tenacity") • Circuit breakers ("pybreaker") • Timeouts ("asyncio", "signal") • Rate limiting ("limits", "slowapi") • Fallbacks (custom code) 👉 These don’t coordinate → messy + inconsistent failure handling 📊 Existing tools: • "tenacity" (retries ~263.6M downloads/month) • "pybreaker" (circuit breaker ~9.6M downloads/month) 👉 Great individually, not unified ⚡pyresilience Benchmark: 🚀 pyresilience → 0.64 μs (🔥 ~10.4x faster) 🐢 tenacity → 6.64 μs 🛠️ What pyresilience does: One decorator with: ✅ Retry ✅ Circuit Breaker ✅ Timeout ✅ Fallback ✅ Bulkhead ✅ Rate Limiter ✅ Cache ➡️ Works together, not glued ➡️ Zero dependency ➡️ Sync + Async ➡️ High performance Frameworks: 🌐 FastAPI • Flask • Django 👨💻 For all Python developers 🔗 GitHub: https://lnkd.in/d-SRygNQ 🔗 PyPI: https://lnkd.in/dRg2H4D5 🔗 Docs: https://lnkd.in/dxZ4xYkw ♻️ Resharing to support the Python community 🤝 💬 How are you handling resilience in Python today? #Python #PythonDeveloper #PythonDev #BackendDevelopment #SoftwareEngineering #DistributedSystems #Microservices #SystemDesign #ResilienceEngineering #FaultTolerance #HighAvailability #ScalableSystems #PerformanceEngineering #AsyncIO #FastAPI #Django #Flask #APIEngineering #CloudNative #DevOps #SRE #OpenSource #OpenSourceProject #PyPI #PythonLibraries #DeveloperTools #TechInnovation #BuildInPublic #Programming
To view or add a comment, sign in
-
-
🚀✨ Sharing something I’ve been building — Code Crawler 🕷️ Ever joined a large Python codebase and spent days 😵💫 figuring out what calls what? Yeah… that frustration led me to build this 👇 💡 Code Crawler helps you understand any Python codebase visually and instantly. Just point it to a GitHub repo (or even a local folder 📂), and it parses everything using AST to generate a function & class-level lineage graph 🧬 🔍 What makes it powerful: ⚙️ Resilient crawl pipeline (Temporal) — survives restarts & scales smoothly 🔗 Cross-repo lineage — track relationships across repos + inheritance chains 🌿 Branch comparison — see what changed & what it impacts downstream ▶️ Run functions from UI — no test setup needed 🧪 Smart mocking — auto-detect dependencies & stub them easily 📊 Batch testing — run multiple test cases together with instant results 📂 Local support — drag & drop projects, no GitHub required 🏢 Multi-tenant architecture — full isolation + invites + admin panel 💭 Why I built this: Understanding a new codebase shouldn’t feel like solving a puzzle 🧩 Instead of jumping across hundreds of files: 👉 Visualize relationships 📈 👉 Trace flows instantly 🔄 👉 Run functions with real inputs ⚡ All in one place. 🚧 Still building, but already super useful for exploring codebases I didn’t write Would love feedback from folks who’ve struggled with large Python projects 🙌🔥 🔗 https://lnkd.in/gtD-5juu #Python 🐍 #SoftwareEngineering 💻 #DevTools 🛠️ #OpenSource 🌍 #FastAPI ⚡ #React ⚛️
To view or add a comment, sign in
-
🚫 I spent hours debugging my API… just because I didn’t understand this one thing in Django REST Framework. I thought Function-Based Views were enough… until my code started getting messy, repetitive, and hard to scale. That’s when I finally understood the real difference between FBVs and CBVs 👇 🔹 What I Learned FBVs feel easy in the beginning. But as soon as your API grows → logic becomes cluttered. CBVs (especially Generic Views & ViewSets) completely changed the game for me: ✔ Cleaner structure ✔ Reusable logic ✔ Scalable architecture 🔹 Example Function-Based View 👇 @api_view(['GET', 'POST']) def product_list(request): if request.method == 'GET': ... elif request.method == 'POST': ... Class-Based View 👇 class ProductView(ListCreateAPIView): queryset = Product.objects.all() serializer_class = ProductSerializer 👉 Same result… but CBVs remove a LOT of manual work. 🔹 What’s Actually Happening? CBVs use: Mixins → handle logic (list, create, update) Generic views → combine mixins ViewSets → full CRUD with routers 👉 You focus on what to build, DRF handles how it works 🔹 Mistakes I Made (and learned from) ❌ Forgot queryset in ViewSet → basename error ❌ Passed Model instead of ViewSet to router ❌ Wrong URL (case-sensitive → 404) ❌ Imported NestedSimpleRouter from wrong module ❌ Didn’t understand router → action mapping 👉 These mistakes actually helped me understand DRF deeply. 🔹 Final Take 👉 FBVs = Good for learning basics 👉 CBVs = Essential for real-world APIs Now I use ViewSets + Routers by default — less code, more clarity 🚀 #Django #Python #BackendDevelopment #SoftwareEngineering #API #Programming #LearnPython #TechTips #100DaysOfCode #TechCommunity
To view or add a comment, sign in
-
-
Docker Image Optimization - Smaller Images, Faster Builds (~70% in my case) My image size went down by 70%. Here's what worked out for me. I'm starting something small. Whenever I learn something worth sharing, I'll post it here - no theory, no fluff. Just a real problem and what I did about it. First up: Docker image optimization. These apply to almost any containerized app - Spring Boot, Python, Node, etc. What made the difference 1. Multi-stage builds Separate build environment from runtime image. The final container only needs the built app, not compilers, build tools, or dev dependencies. Biggest size reduction. 2. Layer caching Copy dependency files first (package.json, pom.xml, requirements.txt), install dependencies, then copy source. If dependencies don't change, Docker skips reinstalling them - builds get significantly faster. 3. Combine RUN commands + cleanup Each RUN creates a new layer. Install and clean in the same RUN or the size is already baked into the previous layer. 4. Slim / Alpine base images Switching from node:20 to node:20-alpine takes the base image from ~1GB to ~170MB. Most official images have an alpine or slim variant - use it unless you have a reason not to. 5. .dockerignore Exclude node_modules, .git, logs, env files, build artifacts so they don't get sent in the build context. None of these are advanced. But they compound fast - and most projects I've seen skip at least two of them. What would you add? Anything I missed - drop it below. #Docker #Backend #LearningInPublic #SWE
To view or add a comment, sign in
-
I have been thinking less about agents and more about paths. A lot of software still assumes execution is: - an app flow - an async mesh - or an agent stack But human work usually looks messier and more real: you carry something, fork, test, return, defer, resume, and only sometimes settle. So I have been exploring a path-style runtime where: - push opens a fork - pop rejoins or abandons a fork - skills attach to the path - memory keeps residue - repeated signals reinforce instead of just duplicating noise The interesting question is not “what is the next token?” It is more like: - what is still being carried? - what changed direction? - what can be deferred? - what actually needs to settle? I may post a tiny Python demo of path execution next. https://lnkd.in/eairkdJK #runtime #systems #paths #softwarearchitecture
To view or add a comment, sign in
-
-
Most beginner backend projects die in refactoring. Here's the structure I use to prevent that. When I built my Task Manager CLI, I learned this the hard way — a monolithic file that worked until it very much didn't. After refactoring, here's the structure I now start with: Before writing a single line: → Define your data model first → Identify all operations (CRUD) you'll need → Map inputs, outputs, and error states While building: → One module per concern (routes, models, utils, exceptions) → Validate inputs at the boundary — not deep inside logic → Handle errors explicitly — no silent failures Before shipping: → Test the unhappy paths, not just the happy ones → Read your own code like a stranger would This approach reduced my debugging effort by 40% on a real project. It works at any scale — from a CLI tool to a FastAPI service. What's the first thing you do when starting a new backend project? #BackendDevelopment #Python #FastAPI #SoftwareEngineering #CodingTips
To view or add a comment, sign in
-
Finding and Removing Dead Code in code bases & scripting Find and remove dead code – before it finds you We’ve all been there: the codebase grows, features come and go, and eventually the code ends up in functions that nobody calls anymore. Particularly tricky: scripting files (Python, Shell, JS), which often exist outside the IDE and are quickly forgotten. 🫵 Why this is problematic: • Maintenance costs: Everyone has to read code that is never executed. • Security risk: Outdated logic may contain vulnerabilities that have never been patched because they were never tested. • Confusion: New team members waste time trying to understand why something exists (“Is this still needed?”) • Slows down builds and increases binary size • Bloats tests and reviews ➡️ How SciTools’ Understand helps Instead of tedious manual searching, Understand does the work for you: 1️⃣ Find unused functions & variables The static analysis detects code that is never called, across all files and languages. 2️⃣Visualize dependencies Graphs immediately show you which modules are isolated and can be removed. 3️⃣ Track references Where is this function used? Understand shows you every reference, or, indeed, none. 4️⃣Scripting included Not just compiled code, your build scripts, helper scripts and automations are analyzed too. ✔️ Best practice: Integrate dead code checks into your workflow: 1. Generate reports regularly 2. Check before every release 3. Plan refactoring strategically The result: A leaner, more maintainable and more secure codebase. Free trial www.emenda.com/trial #SoftwareEngineering #DeadCode #CodeQuality #Refactoring #CleanCode #Understand #SciTools #Scripting
To view or add a comment, sign in
-
-
#The_most_expensive_comma_I’ve_ever_typed. 💸 I recently spent way too long debugging a background task that was "failing successfully." No errors in the frontend, no crashes in the logs—just... silence. The culprit? A single trailing comma at the end of a string: #email_body = "Hello there...", In Python, that tiny comma turns your intended String into a Tuple. So, instead of sending a block of text to the email handler, I was sending ("Hello there...",). Because we had fail_silently=True enabled in our background thread (standard practice to keep the UI snappy), the system was quietly choking on the Tuple and dying without a word. #The Lesson: Syntax Matters: Even in a "readable" language like Python, one character changes the entire data structure. The Danger of Silence: fail_silently is a double-edged sword. It keeps the user experience smooth, but it can bury the "why" during development. Log Everything: If it’s failing silently, make sure your logger isn’t! Has a single character ever brought down your entire workflow? Let’s commiserate in the comments. 👇 #Python #SoftwareEngineering #CodingLife #Debugging #Django #WebDevelopment
To view or add a comment, sign in
-
Decoupling logic in Django is always an interesting architectural challenge. Recently, I’ve been relying more on Django Signals to keep my models clean and enforce a strict separation of concerns. For those who haven't dug into how they work under the hood: Django signals essentially implement the Observer design pattern. There is a central dispatcher, when a specific action occurs in the application (the sender), the dispatcher routes that event to any function "listening" for it (the receiver), allowing them to execute their own logic independently. In the snippet below, I’m using the post_save signal. Whenever a new Student instance is successfully created, this receiver catches the signal and automatically generates a CreditWallet for them. Why use a signal here instead of just overriding the save() method on the Student model? It comes down to encapsulation. Overriding save() works fine for simple apps, but as a project grows, it can lead to massive, bloated models. By using signals, the Student model remains strictly responsible for student data, while the financial/wallet logic is encapsulated in its own domain. It makes the codebase much easier to maintain, scale, and test. I’m curious to hear from other developers on here: What is the most complex, creative, or technically challenging way you have utilized Django signals in a project? I'd love to learn from your experiences! #Django #Python #SoftwareEngineering #WebDevelopment #Architecture #Coding
To view or add a comment, sign in
-
-
Meet Albert: The Austrian AI Agent that simply refuses to quit...⛰️ ...Albert isn't just another Python wrapper. He was born out of a need for resilience and true autonomy. He’s one of the first AI agents coming out of Austria, and he’s built differently... ...Albert is model-agnostic. He doesn’t care if you hit a rate limit with Codex or Claude. While other tools freeze your entire terminal, Albert just keeps going. Same interface, any model, no lock-in. The session stays alive because the mission stays alive. Why Albert is a different breed: ⚡ Agent-Native & Fast: Built for execution, not just conversation. 🧠 Huge Skillset: From /init (mapping your entire repo) to /loop (autonomous mode until the job is done). 🦀 Rust-Powered: We hardbaked a Rust token saver into the backend to keep things lean and efficient. 🛡️ End-to-End Logic: Whether it’s /tdd (test-driven development), /bughunter, or a full /code-review, Albert handles the heavy lifting. We moved away from the fragility of standard CLIs because we wanted a partner that works as hard as we do. No more "fake certainty," no more manual translation, and no more starting over because of a timeout. Be like Albert. Be open-core. He’s still a work in progress, but he’s already ready to work. 👉 Take Albert for a spin here: https://lnkd.in/dCaWnfEd Leading with purpose. Innovating with people. Thriving with AI. #AI #AustrianTech #AIAgents #OpenCore #SoftwareEngineering #Ternlang #AlbertAI #EBAIL #RFIRFOS
i rethink the obvious, then build things that matter | head of research& cofounder @ rfi-irfos | youth mentor @ sindbad graz | observational scientist, macro-analyst, host | green tea? 𒀭
this is not a python wrapper. albert is model-agnostic. it doesn’t care if you hit rate limits with codex or claude and your whole CLI freezes. it just keeps going. same interface. any model. no lock-in. session keeps going. 👉 fast 👉 agent-native 👉 huge built-in skillset 👉 rust token saver hardbaked into the backend. Slash Commands include but not limited to: /auth → connect any provider /init → map your entire repo /plan → multi-step execution + risk analysis /loop → autonomous agent until mission complete /tdd → test-driven dev, end-to-end /code-review → security + quality audit /build-fix → detect & fix build errors /bughunter → find and triage issues /refactor → clean and consolidate code /commit → generate commit messages /pr → open pull requests /compress → manage context window /status → session state /help → full command list we got tired of CLIs breaking the moment the model taps out. so we built one that doesn’t. be like albert. be open-core. try our work in progress: https://lnkd.in/dCaWnfEd
To view or add a comment, sign in
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