🚀 𝗦𝗵𝗶𝗽𝗽𝗲𝗱 𝗠𝘆 𝗙𝗶𝗿𝘀𝘁 𝗣𝘆𝘁𝗵𝗼𝗻 𝗣𝗮𝗰𝗸𝗮𝗴𝗲 𝗼𝗻 𝗣𝘆𝗣𝗜… 𝗮𝗻𝗱 𝗦𝗼𝗺𝗲𝘁𝗵𝗶𝗻𝗴 𝗪𝗶𝗹𝗱 𝗛𝗮𝗽𝗽𝗲𝗻𝗲𝗱 📝✨ I thought this would be a simple “publish & move on” project. Turns out… it became one of the biggest learning curves of my dev journey. 👀🔥 💥 Broken builds 💥 Weird packaging errors 💥 Unexpected CLI bugs And a lot of “why is this even failing?” moments. But today… after all the chaos: 𝗧𝗼𝗱𝗮𝘆, 𝗜 𝗼𝗳𝗳𝗶𝗰𝗶𝗮𝗹𝗹𝘆 𝘀𝗵𝗶𝗽𝗽𝗲𝗱 𝗧𝗲𝘅𝘁𝗻𝗼𝘁𝗲𝘀 🐍 A tiny CLI tool. One command. Surprisingly useful. 💡 The biggest win? Not just shipping… Learning how packaging works, debugging real-world errors, and shipping something people can actually use. 👉 Read the full story: 🌐 https://lnkd.in/db7a5neY 𝗧𝗿𝘆 𝗜𝘁: 🐍 PyPI → https://lnkd.in/dpzhWn_A 💻 GitHub → https://lnkd.in/dS9W57bE 🔁 Share to help others ❤️ Like if you found it useful 📥 Save for your next project 👥 Tag someone who needs this #python #pythonprogramming #KnowledgeSharing
Shipping PyPI Package and Learning from Errors
More Relevant Posts
-
*Debugging Lesson from a Real-World Integration* While working on a Python-based bot integration, I ran into an interesting issue that initially looked like a simple dependency error — but turned out to be a deeper compatibility problem. *The Error:* ModuleNotFoundError: No module named 'pkg_resources' AttributeError: module 'pkgutil' has no attribute 'ImpImporter' At first glance, it seemed like a missing package. But even after installing dependencies, the issue persisted. *Root Cause:* The environment was running on Python 3.12, where certain legacy components like pkgutil.ImpImporter have been removed. However, some widely used libraries (and their dependencies) still rely on these older components — leading to unexpected runtime failures. *Solution:* Instead of patching individual packages, the clean and stable solution was: - Align Python version to 3.10 - Use compatible versions of dependencies 💡 Key Takeaways: • Not every issue is a “missing install” problem • Ecosystem compatibility matters more than latest versions • Stable environments > cutting-edge versions in production Sometimes, the real bug is not in your code — but in the version mismatch between your tools. #Python #Debugging #SoftwareEngineering #BackendDevelopment #LearningJourney
To view or add a comment, sign in
-
🚀 𝗕𝘂𝗹𝗸 𝗧𝗲𝘅𝘁 𝗥𝗲𝗽𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗳𝗼𝗿 𝗪𝗼𝗿𝗱 – 𝗻𝗲𝘄 𝘂𝗽𝗱𝗮𝘁𝗲 𝗿𝗲𝗹𝗲𝗮𝘀𝗲𝗱! After receiving nice feedback on Reddit about my 𝗕𝘂𝗹𝗸 𝗧𝗲𝘅𝘁 𝗥𝗲𝗽𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗼𝗼𝗹, I decided to build on the momentum and release an updated version. Here's what's new: 🔍 𝗥𝗲𝗮𝗹-𝘁𝗶𝗺𝗲 𝗺𝗮𝘁𝗰𝗵 𝗰𝗼𝘂𝗻𝘁𝗲𝗿 — see how many matches exist across your files as you type, before running any replacement 👁️ 𝗗𝗶𝗳𝗳 𝗽𝗿𝗲𝘃𝗶𝗲𝘄 — Standard Preview now shows context snippets so you can see exactly where matches appear in your documents 🧩 𝗥𝗲𝗴𝗲𝘅 𝘀𝘂𝗽𝗽𝗼𝗿𝘁 — use Python regular expressions in your search pattern for powerful, flexible matching (e.g., \d+, (foo|bar)) 🔤 𝗪𝗵𝗼𝗹𝗲 𝘄𝗼𝗿𝗱 𝗺𝗮𝘁𝗰𝗵 — avoid partial matches inside longer words (works with both Standard and Advanced Replace) 🗂️ 𝗦𝗶𝗺𝗽𝗹𝗶𝗳𝗶𝗲𝗱 𝘁𝗼 𝗮 𝘀𝗶𝗻𝗴𝗹𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗳𝗶𝗹𝗲 — no more VBScript dependencies, faster advanced replacements 𝘛𝘩𝘦 𝘵𝘰𝘰𝘭 𝘳𝘦𝘮𝘢𝘪𝘯𝘴 𝘧𝘳𝘦𝘦. 𝘍𝘦𝘦𝘥𝘣𝘢𝘤𝘬 𝘢𝘯𝘥 ⭐ 𝘰𝘯 𝘎𝘪𝘵𝘏𝘶𝘣 𝘢𝘭𝘸𝘢𝘺𝘴 𝘸𝘦𝘭𝘤𝘰𝘮𝘦! 👉 [https://lnkd.in/eZJ_-i9z] #Python #MicrosoftWord #Automation #OpenSource #Productivity
To view or add a comment, sign in
-
I wrote a CLI tool to help your teams catch "slop" code before it creates a mountain of tech debt. Runs for any python projects 3.10 -> 3.13. Drop it in your CI/CD pipelines to act as a last linter for AI specific slop patterns like vague comments, util functions, and more. Check it out! https://lnkd.in/e5xNUwH2 https://lnkd.in/eT6psfZS
To view or add a comment, sign in
-
🚀 Day 310 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “454. 4Sum II” ✅ Problem: You are given 4 integer arrays of the same length. Return the total number of tuples (i, j, k, l) where picking one number from each array adds up exactly to 0. ✅ Approach (Divide & Conquer + Hash Map) A brute-force approach with 4 nested loops would take O(N⁴) time, which will instantly throw a Time Limit Exceeded (TLE) error. Instead, we can split the problem right down the middle! Group 1 & 2: I used a nested loop to calculate every possible sum of pairs from nums1 and nums2. I stored these sums and their frequencies in a Hash Map (Python's defaultdict). Group 3 & 4: I used another nested loop to calculate the sums of pairs from nums3 and nums4. The Match: For every sum in the second group, we need a specific number from the first group to make the total 0. That number is simply -(sum3 + sum4). I just checked the Hash Map for that exact value and added its frequency to our result counter! ✅ Key Insight By splitting a 4-part problem into two 2-part problems and using a Hash Map as a bridge, we drastically reduce the work. We effectively change the math from N \times N \times N \times N to N^2 + N^2. It’s a beautiful example of trading space (memory for the Hash Map) to gain a massive amount of speed. ✅ Complexity Time: O(N²) — We run two separate sets of nested loops. Space: O(N²) — In the worst-case scenario, every sum from nums1 and nums2 is unique and gets stored in the Hash Map. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #Arrays #HashMap #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Day 303 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “532. K-diff Pairs in an Array” ✅ Problem: Given an array of integers and an integer k, return the number of unique pairs where the absolute difference between the two numbers is exactly k. ✅ Approach (Hash Map / Frequency Counter) Instead of a slow double loop, we can use a Hash Map (Python's Counter) to solve this in linear time. Count Frequencies: First, tally up how many times each number appears in the array. Handle k = 0: If the target difference is 0, we just need to find numbers that appear at least twice. I looped through the map and counted elements with a frequency > 1. Handle k > 0: For a non-zero difference, iterate through the unique numbers in the map. For each number x, simply check if x + k exists in the map. If it does, increment the count! ✅ Key Insight By using a map of unique numbers and only checking for x + k (looking "up" the number line), we naturally handle the absolute value requirement and completely prevent double-counting pairs like (1, 3) and (3, 1). The uniqueness is guaranteed without ever needing to store the results in a Set! ✅ Complexity Time: O(N) — One pass to build the frequency map, and at most one pass through its unique keys. Lookups are O(1). Space: O(N) — To store the frequency map. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #Arrays #HashMap #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Day 307 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “3766. Minimum Operations to Make Binary Palindrome” ✅ Problem: You are given an array of integers. You can increment or decrement any number by 1. Find the minimum number of operations required to turn each number into a "binary palindrome" (a number whose binary representation, without leading zeros, reads the same forwards and backwards). ✅ Approach (Precomputation + Binary Search) Instead of checking numbers one by one to see if they are binary palindromes, we can pre-build the answers! Precompute: I looped through a fixed range (up to 5000) to generate and store all valid binary palindromes in a sorted list. Binary Search: For each number in the input array, I used bisect_right to quickly find its position within our precomputed list. Compare: This gives us the closest binary palindrome above the number and the closest one below it. Just calculate the absolute difference for both and pick the smaller one! ✅ Key Insight Precomputing the search space is a massive time-saver! Because binary palindromes are actually quite sparse, building a lookup array once prevents us from constantly doing expensive string conversions and reverse-checks inside the main loop. Combined with Binary Search, finding the nearest neighbor becomes blazing fast. ✅ Complexity Time: O(N log P) — Where N is the length of the array and P is the number of precomputed palindromes. Binary search takes log P time for each element. Space: O(P) — To store our lookup array of binary palindromes. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #BinarySearch #Precomputation #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Day 308 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “503. Next Greater Element II” ✅ Problem: Given a circular integer array (the element after the last element is the first element), return the next strictly greater number for every element. If it doesn't exist, return -1. ✅ Approach (Monotonic Stack + Loop Twice) A brute-force double loop would be O(N^2). We can optimize this to linear time using a Monotonic Stack! The Stack: Use a stack to store the indices of numbers that are still "waiting" to find their next greater element. The Circular Trick: Instead of messy modulo arithmetic (i % n), just loop through the array exactly twice. This naturally simulates the circular wrap-around! The Logic: As we iterate, we compare the current number to the number at the index on top of the stack. If the current number is bigger, we've found the "next greater" for that stack element! Pop it off, update our result array, and repeat. Then, push the current index onto the stack. ✅ Key Insight Monotonic Stacks are the ultimate cheat code for "next greater/smaller" problems. By keeping the stack strictly decreasing, we instantly know when we've hit a "peak" that resolves the waiting elements. Combining this with the "loop twice" trick makes handling the circular property completely effortless. ✅ Complexity Time: O(N) — Even though there are nested while loops, each index is pushed and popped from the stack at most once across the two passes. Space: O(N) — To store the stack and the result array. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #Stack #MonotonicStack #Arrays #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
Lessons from #Day_1: Building my #TextToSqlApp I already missed a basic validation part Here's what I set up: → Python installed + environment path configured → GitHub repo created (text-to-sql-app) → Created virtual environment with venv for project folder → Installed: LangChain, LangChain-Community and few dependencies → Installed Ollama on Windows → Pulled Llama 3.2 locally → Tested the model — it works! All good. Except one part. Ollama kept failing to download. I thought it was the network or invalid executions Nope. I found in the terminal that "there is not enough space on disk". Ollama is around 1.6 GB file. then cleared 30 GB. Downloaded in minutes. The most basic thing to check, but I skipped it. If you're installing Ollama locally, just check your disk space first. You'll need around 4 GB total between Ollama and the llama model. 🤖 BONUS Once it was running, I had some fun test conversations with Llama 3.2 directly in the terminal. The model is surprisingly sharp for a 2 GB file running 100% locally No API, no internet, no cost involved Day 2 goal: create the SQLite database and get Python talking to the LLM. Following along? Drop a comment — would love to know what was the mistake you've hit while building AI Agent 👇 #BuildingInPublic #AI #Ollama #Python #LangChain
To view or add a comment, sign in
-
-
🚀 Day 311 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “946. Validate Stack Sequences” ✅ Problem: Given two integer arrays with distinct values, pushed and popped, return true if they represent a valid sequence of push and pop operations on an initially empty stack. ✅ Approach (Greedy Simulation) The best way to know if a sequence works is to just try it! Simulate: Create an actual stack array and a pointer i to track our position in the popped array. Push & Check: Loop through the pushed array, adding each number to our simulated stack. Pop Greedily: Immediately after pushing, use a while loop to check if the top of the stack matches the current target in popped[i]. If it does, pop it off and move our target pointer forward (i += 1). Keep popping as long as the top continues to match! Result: If the input sequences are valid, every pushed element will eventually be matched and popped, leaving us with an empty stack (len(stack) == 0). ✅ Key Insight Don't overthink with complex math or permutations! The rules of a stack make this strictly deterministic. If the top of your stack matches the next required popped value, you must pop it right then and there. By greedily executing the only logical move at every step, the simulation perfectly validates the sequence in a single pass. ✅ Complexity Time: O(N) — Where N is the length of the arrays. Even with the inner while loop, every element is pushed exactly once and popped at most once, making it linear time. Space: O(N) — We use an extra array to act as our simulated stack. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #Stack #Simulation #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
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
Congrats ❤ Quite a big accomplishment